home *** CD-ROM | disk | FTP | other *** search
/ Action Games (2008) / akcnihry1.iso / AT-Robots 2.10 / ATR2.DOC < prev    next >
Encoding:
Text File  |  1999-06-23  |  101.2 KB  |  2,209 lines

  1.  
  2.                         Advanced T-Robots (AT-Robots)
  3.                                  version  2
  4.                                    (ATR2)
  5.  
  6.                      Copyright (C) 1997, Ed T. Toton III
  7.                             All Rights Reserved.
  8.  
  9.                      http://www.necrobones.com/atrobots/
  10.  
  11.  
  12. ----------------------------------------------------------------------------
  13. For current CONTACT INFORMATION see:   NBONES.DOC
  14. ----------------------------------------------------------------------------
  15. CONTENTS:
  16.  
  17.   Introduction
  18.   Credits
  19.   Trademarks & Copyrights
  20.   Things you should have
  21.   Running AT-Robots
  22.     - Settings
  23.     - During the Simulation
  24.   Locking Robots
  25.   Acronyms, Abbreviations, and Definitions
  26.   What's new to ATR2
  27.   Basics and General Info
  28.   Hexidecimal
  29.   Programming Robots
  30.     - Statements
  31.     - Compiler Directives
  32.     - Robot Configurations
  33.     - Registers
  34.     - Instructions
  35.     - Ports
  36.     - Interrupt Calls
  37.     - Memory Map
  38.     - Constants
  39.     - Writing the code
  40.     - Errors
  41.     - Designing the perfect robot
  42.   The Physics of AT-Robots
  43.   Staging a Competition
  44.   Trouble-Shooting & Speed-Control
  45.   Legal Shtuffs
  46.     - License & Disclaimer
  47.     - Registration
  48.   Revision History
  49.   Final note
  50.  
  51. ----------------------------------------------------------------------------
  52. INTRODUCTION:
  53.  
  54.   Welcome to Advanced T-Robots, a game in which players write programs to
  55. control robots which will battle to the death in a simulated arena, using
  56. a programming language similar in design and concept to PC assembly language.
  57.  
  58.   This particular game is ATR2, or rather, the second AT-Robots.
  59. Unfortunately, though much remains the same, some fundamental changes made
  60. downward compatablility impossible. If you used AT-Robots 1.x, you will
  61. either need to make new robots from scratch or convert your old ones by hand.
  62. Further down, I will explain what has changed and what is the same.
  63.  
  64.    AT-Robots stands for "Advanced T-Robots", though "AT" can also refer to
  65. AT-class PC's, since it will run on 286's and higher. T-Robots was the
  66. predecessor program to this, written originally in November of 1991. It was
  67. inspired by P-Robots (written by David Malmberg), which was in turn inspired
  68. by C-robots (written by Tom Poindexter). T-Robots and AT-Robots are designed
  69. with the idea of programming robots, without going to the lengths of learning
  70. to program in high-level languages, but to still allow fairly simple program
  71. design. In the case of AT-Robots, the language is based on PC assembly.
  72. Basically, T-Robots allowed you to use T-Robot-Basic to program the robots,
  73. and now in AT-Robots you use T-Robot assembly. Instead of having complex
  74. commands for complex tasks, you have simple commands to do simple tasks. You
  75. will have to design subroutines to access the specific devices/ports/memory
  76. areas of the robot specifically in your program. The language has a small
  77. amount of available commands, thus making it easy to learn, while offering
  78. experienced programmers an interesting challenge. Though it is not a real
  79. programming language of sorts, it can still teach the basic concepts of
  80. programming and logical thinking.
  81.  
  82.    The first incarnation of AT-Robots was in February of 1992, only 3 months
  83. after the initial T-Robots program. After that, AT-Robots remained dormant
  84. from a development standpoint, but continued to be used occasionally by
  85. people around the world for fun and for educational purposes. The original
  86. versions were primarily distributed through my own personal BBS, and through
  87. a very large BBS that I often used for launching my shareware programs (The
  88. Programmer's Corner), and then eventually through AOL. Then in March of 1997,
  89. AT-Robots version 2 came on the scene, which coincided with my obtaining my
  90. own domain name on the World Wide Web. I made announcements on several usenet
  91. newsgroups, and ran a contest. Since then the game has slowly trickled out
  92. into the world.
  93.  
  94.  
  95. -----------------------------------------------------------------------------
  96. CREDITS:
  97.  
  98.       Concept, Design, Programming     - Bones (Ed T. Toton III)
  99.       Debugger                         - FiFi LaRoo
  100.  
  101.  
  102. -----------------------------------------------------------------------------
  103. TRADEMARKS & COPYRIGHTS:
  104.  
  105.       AT-Robots v2 (c) 1997  Ed T. Toton III
  106.       AT-Robots    (c) 1992  Ed T. Toton III
  107.       T-Robots     (c) 1991  Ed T. Toton III
  108.       P-Robots     (c) 1988  David Malmberg
  109.       C-Robots     (c) 1985  Tom Poindexter
  110.       Turbo Pascal is a registered trademark of Borland International.
  111.  
  112.       All robots are under copyright of their respective authors.
  113.  
  114.  
  115. ----------------------------------------------------------------------------
  116. THINGS YOU SHOULD HAVE:
  117.  
  118.   First of all, you need DOS 3.3 or higher (or Win95's DOS), some free
  119. hard drive space, a VGA or SVGA, and at least a 286 PC processor. That
  120. covers the hardware.
  121.  
  122.   You will also need a text editor. DOS (starting with 5.0) comes with
  123. a built-in text editor called EDIT. Whatever you use doesn't matter
  124. specifically, as long as you save your robot programs in "DOS Text" or
  125. "ASCII format" (must be the DOS standard of CR,LF ending each line).
  126.  
  127. Files:
  128.  
  129.   ATR2.EXE      - The main program.
  130.   ATR2.DOC      - This document.
  131.   NBONES.DOC    - Contact information.
  132.   READ.EXE      - A text viewer.
  133.   ATRLOCK.EXE   - Encrypts robots for distribution.
  134.   demo.bat      - Demo batch file
  135.   demo.ats      - Demo config file.
  136.   file_id.diz   - BBS auto-description file
  137.   *.at2         - These are robot programs, all ending in .AT2
  138.   *.pas,*.tpu,*.obj -Source code files for AT-Robots.
  139.  
  140. ----------------------------------------------------------------------------
  141. RUNNING AT-ROBOTS:
  142.  
  143.   Before we get into the language, let me first explain how to run the game.
  144. If you try running AT-Robots just by typing ATR2, this is what you will see:
  145.  
  146. Error #5: Robot names and settings must be specified.
  147.  
  148.   Well, here's how you do just that. ATR2 must be run using command-line
  149. parameters. Here's an example:
  150.  
  151. ATR2 /s #myconfig
  152.  
  153.   Any parameter that is preceded by a slash (/) or a dash (-) is a setting.
  154. Any parameter preceded by a pound sign (#) is a configuration file (in this
  155. case "MYCONFIG.ATS"). If no extension is specified in the filename, ".ATS"
  156. is asswumed.
  157.  
  158.  Parameters not starting with these characters are assumed to be robot
  159. filenames.
  160.  
  161. Example:   ATR2 /s /m2 myrobot yourobot
  162.  
  163.   In this case two settings are specified, and two robots are loaded,
  164. specifically "myrobot.at2" and "yourobot.at2" (if a filename extension
  165. is not specified, it is assumed to be ".AT2").
  166.  
  167.   If you want to load a locked robot, you can either specify the ".ATL"
  168. extension (i.e. "MYROBOT.ATL") or precede the namee with a question mark (?)
  169. (i.e. "?MYROBOT").
  170.  
  171. Settings:
  172.  /S  = Do not show source code during compile (must appear before robot names)
  173.  /Dn = Specify game-delay (timing control), [default=30], example: /D20
  174.  /Tn = Specify time-slice for robots [default=5] (cpu cycles per game cycle)
  175.  /Ln = Specify battle time-limit in 1000's, 0 means no limit [default=0]
  176.  /Q  = Quiet Mode, no sound effects.
  177.  /Mn = Specify number of matches to play. ex- /M10 is 10 matches.
  178.  /G  = No graphics, just generate a quick result.
  179.  /Rn = Generate a report file after battle (for use with tournament program) *
  180.  /C  = Compile only, do not run battle (for debugging and verifying)
  181.  /A  = Show scan arcs during battle
  182.  /W  = Windoze=off,  Do not pause with windowed information. ***
  183.  /E  = Turn on error-logging for robots.
  184.  /#n = Specify maximum robot program length. ex- /#32 is 32 compiled lines **
  185.  /!n = Insane missles (n can be 0 to 15). Never use for tournaments!
  186.  /@  = Use old shield style (no damage or heat taken from hits).
  187.  /Xn = Start in debug mode and set the step count 1-9 (/X is equivalent to /X1)
  188.  
  189.  * See below for report-file format
  190.  
  191.  ** NOTE- parameters affecting compilation, such as /S or /# must come
  192. BEFORE the robots they are affecting. This means you can have different
  193. program length limitations for different robots.
  194.  
  195.   ex- ATR2 /#10 small.at2 /#50 medium.at2 /#1000 large.at2
  196.  
  197.  *** /W turns off the bout results in both graphics and text modes. Only
  198. the absolute final results will be desplayed if this parameter is used,
  199. and not the intermediate results. This can be toggled at runtime with the
  200. "W" key, whether you're in text or graphics mode at the time.
  201.  
  202. Creating a config file is very easy, simply use the same parameters that
  203. you would on the command line, except in the file they are placed one per
  204. line. For an example, see DEMO.ATS. In a config file, any blank lines or
  205. lines starting with a semi-colon (;) are ignored.
  206.  
  207.  
  208. DURING THE SIMULATION:
  209.  
  210.   While the simulation is running, there are several keyboard commands you
  211. can use:
  212.  
  213.   A = Turn on/off the displaying of scan arcs
  214.   S = Turn sound effects on/off
  215.   G = Turn graphics on/off
  216.   T = Turn timing on/off
  217.   + = Increase timing delay (game runs slower)
  218.   - = Decrease timing delay (game runs faster)
  219.   W = Toggle 'windoze' (pausing at displayed windows)
  220.   C = recalibrate timing (timer might have mis-calibrated if
  221.       a cache program such as smartdrive was still writing data).
  222.   X = Turn the debugger on/off (Robot #1 must be unlocked).
  223.       While in debug mode, there are several additional keyboard commands
  224.       you can use:
  225.         SPACEBAR = Step with current step count
  226.         1 .. 9   = Set a new step count and step
  227.         -,+,[,]  = Scroll the memory view
  228.   ESC or Q  = Quit.
  229.   Backspace = End current match.
  230.  
  231.   If the game is running without graphics, timing and sound will also be off
  232. since they only make sense when you're watching the action. You can use these
  233. keyboard commands whether the game started in graphics mode or not.
  234.  
  235.  
  236. REPORT FORMAT:
  237.  
  238.   The report-file is for use with the tournament program or other shells
  239. that want to read information back from ATR2 about the results of the
  240. battle. There are multiple formats available. They're all basically the
  241. same, except for the amount of information included. The older ones are
  242. kept for downward compatability as new ones are added.
  243.  
  244.   In each case, the first line is the number of robots in the report.
  245. After that, each robot gets its own line. On the robot lines, several
  246. numbers are given, seperated by spaces, and the name is listed last.
  247. All report modes are enabled with the /R parameter, possibly with a
  248. number to denote the specific one.
  249.  
  250. An example /R report:
  251.  
  252. 2
  253. 0 1 SNIPER 
  254. 1 1 RANDMAN3
  255.  
  256. The line formats for each report mode:
  257.  
  258. /R :  Wins Trials Name
  259. /R2:  Wins Trials Kills Deaths Name
  260. /R3:  Wins Trials Kills Deaths EndingArmor EndingHeat ShotsFired Name
  261. /R4:  Wins Trials Kills Deaths EndingArmor EndingHeat ShotsFired Hits DamageTotal CyclesLived ErrorCount Name
  262.  
  263.  
  264. ----------------------------------------------------------------------------
  265. LOCKING ROBOTS:
  266.  
  267.   When it comes time for you to use your robot in a competition, you may
  268. want to allow others access to your robot but without making it easy for
  269. them to discover its secrets. For this reason, there is a program included
  270. with AT-Robots called ATRLOCK. It removes all remarks from the robot and
  271. then encrypts it. It's not a particularly complex encryption scheme, just
  272. enough to make it unreadable.
  273.  
  274.   For all you hackers out there who are thinking of cracking it or making
  275. an un-lock program, I ask you nicely to please not do so.
  276.  
  277.   To use ATRLOCK, simply specify the robot to be locked:
  278.  
  279. example:
  280.   ATRLOCK sniper
  281.  
  282.   This will encrypt "SNIPER.AT2" into "SNIPER.ATL". To use the LOCKed
  283. SNIPER in a game, you could simply load it as "?SNIPER".
  284.  
  285.  
  286. ----------------------------------------------------------------------------
  287. ACRONYMS & ABREVIATIONS & DEFINITIONS:
  288.  
  289.   Here in ATR (see, there's one already) we use several acronyms that you
  290. may or may not already be familiar with. At anyrate, here they are (but
  291. don't worry about memorizing them):
  292.  
  293.   Acronym:          Meaning:
  294.     ATR                 AT-Robots, or a robot for AT-Robots.
  295.     ATR1                AT-Robots, versions 1.0 and 1.1
  296.     ATR2                AT-Robots, versions 2.0+
  297.     ATRA                Advanced T-Robots Assembly.
  298.     BIOS                Basic Input/Output System
  299.     ERR                 Error
  300.     GSB                 Gosub (a call to a subroutine)
  301.     I/O or IO           Input/Output
  302.     INT                 Interrupt
  303.     JMP                 Jump  (like a GOTO in basic)
  304.     OP                  Op-Code (numeric codes that represent instructions)
  305.     RAM                 Random-Access Memory.
  306.     REG                 Register
  307.     ROM                 Read-Only Memory.
  308.     ROS                 Robot Operating System.
  309.     SPD                 Speed
  310.     VAR                 Variable
  311.     LOCK                Encryption for robot distribution
  312.  
  313. ----------------------------------------------------------------------------
  314. WHAT'S NEW TO ATR2:
  315.  
  316.   If you've never used AT-Robots 1.x, skip this section.
  317.  
  318.   One of the most important changes is the memory addressing system, and
  319. how operands are stored and decoded internally. In ATR1, what an operand
  320. did was completely defined by its value. Anything over 10000 was a memory
  321. address. Now you have the full range of integer values to use as numbers,
  322. or as values in variables, since there is now seperate microcode stored
  323. to define the function of an operand.
  324.  
  325.   A few of the I/O ports have changed, but most are the same. All of the
  326. Interrupts have been redefined. Most of the instructions in the language
  327. are the same, except conditional jumps can not be used as conditional
  328. gosubs, and basic math functions use only 2 operands instead of 3.
  329.  
  330.   The list of registers has also changed. However, if you were simply using
  331. some of the old ones as generic variables, why not create them as variables
  332. if you convert your robots over? The variables that are used for passing
  333. values back and forth to interrupts have changed of course.
  334.  
  335.   The accuracy setting parameter that you send to the weapon port is
  336. no longer translated into degrees automatically. You must do this yourself
  337. before passing the parameter.
  338.  
  339.   One more MAJOR change is that the game uses a 256 degree circle instead
  340. of 360.
  341.  
  342.   Why so many changes? Especially that circle thing? Here's why- I designed
  343. the original AT-Robots before my programming expertise really allowed me to
  344. do as good of a job as this project deserved. I was only starting to learn
  345. assembly at the time, and here I was making my own version! I was not yet
  346. used to dealing with powers of two, individual bits, bit-manipulation
  347. instructions, and hexidecimal. I ended up making the language in such a way
  348. as to steer you away from these valuable programming techniques, and was
  349. therefore teaching the wrong lessons! Now I'm going to beat hexidecimal and
  350. powers of two into everyone's skulls...  :-)
  351.  
  352. 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048,
  353. 4096, 8192, 16384, 32768, 65536, to name a few...   :-)
  354.  
  355. ----------------------------------------------------------------------------
  356. BASICS & GENERAL INFO:
  357.  
  358.   The arena is 1 kilometer wide and 1 kilometer long. The coordinate system is 
  359. set up such that (0,0) is at the upper-left corner and (1000,1000) is at the 
  360. lower-right.
  361.  
  362.   The screen is set up as follows:
  363.  
  364.    0,0  ________________________________________  1000,0  
  365.        |                                        |          |
  366.        |                                        |          |
  367.        |                                        |----------|
  368.        |                                        | status   |
  369.        |                                        |   areas  |
  370.        |                                        |----------| (side of
  371.        |               Arena                    |          |  screen)
  372.        |                                        |          |
  373.        |                                        |----------|
  374.        |                                        |          |
  375.        |                                        |          |
  376.        |                                        |----------|
  377.        |                                        |          |
  378.        |                                        |          |
  379.        |                                        |          |
  380. 0,1000 |________________________________________| 1000,1000|
  381.  
  382.  
  383.  
  384.  
  385.    Navigation is done in a 256 degree circle, with 0 being north. Here are
  386. the directions for each course:
  387.  
  388.                      0 (256)                            000h (100h)
  389.     Decimal:         |               Hexidecimal:        |
  390.                 224  |  32                         0E0h  |   020h
  391.                    \ | /                               \ | /
  392.            192 ----- + ----- 64               0C0h ----- + ----- 040h
  393.                    / | \                               / | \
  394.                 160  |   96                        0A0h  |   060h
  395.                      |                                   |
  396.                     128                                 080h
  397.  
  398.                                (hexidecimal will be briefly explained later)
  399.  
  400.  
  401.    The Robots are all equipped with a scanner, armor, and a weapon.
  402.  
  403.    Firing the weapon generates heat, which can impair the robots performance.
  404. When the projectile hits an enemy robot, the amount of damage that the
  405. target takes will depend entirely on how accurate the shot was. When a robot
  406. is destroyed, it explodes, possibly causing damage to nearby robots.
  407.  
  408.    Firing the weapon at point-blank can be dangerous, since the weapon blast
  409. can hit everything within a given range. How much damage the weapon does
  410. depends on how "on-target" the shot was.
  411.  
  412.    Each robot is also equipped with a feature called "overburn" which allows
  413. the robot to increase its performance by cranking more energy out of its
  414. power-supply (by disengaging certain safety measures), but at the cost of
  415. easily over-heating. When on overburn, missiles will work more effectively, 
  416. and the robot will drive faster. 100% throttle is still maximum speed,
  417. as the speed of the robot is automatically scaled based upon it's current
  418. performance.
  419.  
  420.    Robots don't stop, start, or turn on a dime. When you tell the robot to 
  421. move at a certain speed, it will accelerate until it reaches that speed or
  422. it collides with something. Once it has reached that speed it will remain 
  423. there until you change it or it collides with something. When the robot
  424. does in fact collide with something, it's speed and throttle are reduced
  425. to zero. If the velocity was greater than half of it's maximum non-overburn
  426. and non-overheated velocity, it takes a point of damage.
  427.  
  428.    When you instruct the robot to turn, it will rotate until it faces the
  429. new direction, or you tell it to do otherwise. The robot will always rotate
  430. in the direction that is shortest to face the target heading. if you tell
  431. it to turn 270 degrees to the right, it will turn 90 to the left (it's 
  432. shorter, and is still the same heading). Also note that since it takes time
  433. to start/stop/turn, that the program may have executed many commands before
  434. the machine actually gets to it's new speed or heading.
  435.  
  436.    Each robot has two status bars on the right-hand side of the screen.
  437. The upper one (marked with an "A"), is the robot's armor. The one below
  438. it (marked with an "H") is the robot's heat scale. Also in the robot's
  439. status area is a space dedicated to displaying error codes. These codes
  440. will be displayed in both decimal and hexidecimal format. They can be
  441. extremely useful as a means of output to see what's going on "in your
  442. robot's head".
  443.  
  444.   Damage:
  445.   ~~~~~~~
  446.    Collision at high speed:          1
  447.    Heat is 300 - 349:                1 every 64 game cycles
  448.    Heat is 350 - 399:                1 every 32 game cycles
  449.    Heat is 400 - 449:                1 every 16 game cycles
  450.    Heat is 450 - 474:                1 every  8 game cycles
  451.    Heat is 475 - 499:                1 every  4 game cycles
  452.    Heat is 500 or higher:            Robot explodes.
  453.    Missile blast:                    14-range (i.e. 14 for dead center,
  454.                                                  and 1 at 13 meters)
  455.    Robot detonation:                 25-range (i.e. 25 for dead center,
  456.                                                  and 1 at 24 meters)
  457.    Mine blast:                       35-range (i.e. 35 for dead center,
  458.                                                  and 1 at 34 meters)
  459.    Overburn Missile blast:           (14-range)*1.25
  460.    Overburn Robot detonation:        (25-range)*1.30
  461.  
  462.  
  463.    It is assumed that the robot bodies have a radius of 4 meters, and
  464. thus the closest you can get to an enemy is 8 meters. Therefore the most
  465. damage you will actually take from another robot exploding is 17, assuming
  466. that it is not on overburn. The missiles however can go off at 0 meters
  467. from the robot if it is targetted precisely. Robot detonations cause the
  468. same amount of damage whether the robot was killed with a missile or it
  469. used a destruct command.
  470.  
  471.  
  472.    Robot performance:              per game cycle:
  473.    ~~~~~~~~~~~~~~~~~~              ~~~~~~~~~~~~~~~
  474.    Normal missile velocity:         32 meters
  475.    Maximum non-overburn speed:       4 meters
  476.    Turn rate:                        8 degrees
  477.    Acceleration                      4% of max forward speed
  478.    Turret rotation                  Instantaneous
  479.  
  480.  
  481.  
  482. WATCH YOUR HEAT!!  Over-heated robots can easily become DEAD robots!
  483.  
  484.   Here is the heat scale:
  485.  
  486.      80+   Max speed reduced to 98%
  487.     100+   Max speed reduced to 95%.
  488.     150+   Max speed reduced to 85%.
  489.     200+   Max speed reduced to 70%.
  490.     250+   Max speed reduced to 50%.
  491.     300+   Heat starts burning armor off (the hotter, the faster)
  492.     400+   Robot stops executing commands until cools below 350 (shutdown).
  493.     500+   Robot explodes.
  494.  
  495.     Also note that during shutdown, the robot's speed is reduced to 0,
  496.     making it a sitting duck.
  497.  
  498.     The shutdown temperature can be altered by accessing port 20.
  499.  
  500.   Normal heat exchanges:  (can be altered with robot configs)
  501.  
  502.     Firing weapon:                 20
  503.     Dissipation per game cycle:     1   ( +1/8 if throttle is -25% to 25% )
  504.  
  505.  
  506. OVER-BURN SHOULD BE USED WITH CAUTION!!!
  507.  
  508.   Overburn effects the following:
  509.              1) faster driving speed                          (130%)
  510.              2) weapon does more damage                       (125%)
  511.              3) weapon projectiles move faster                (125%)
  512.              4) weapon generates more heat                    (150%)
  513.              5) nastier explosion from death or self-destruct (130%)
  514.              6) worse heat dissipation                        ( 66%)
  515.  
  516.    (all percentages are of original total- i.e. 130% means 30% increase).
  517.  
  518.    Note that Overburn multipliers are applied to your robot's actual
  519.    status. For instance, if your driving speed has been adjusted to
  520.    150% using robot configs, and then you turn on overburn, you're
  521.    actually going to go 95% over standard speed (195%).
  522.  
  523.  
  524.  
  525. ----------------------------------------------------------------------------
  526. HEXIDECIMAL:
  527.  
  528.   This section is intended just as a refresher, not as a lesson in
  529. hexidecimal.
  530.  
  531.   Hexidecimal is very useful to programmers since each digit perfectly
  532. represents 4 bits (a nybble, which is half of a byte). 4 bits can store
  533. a number from 0 to (2^4)-1, or 0 - 15. Since there are no single-digit
  534. symbols for 10 to 15, we use A to F:
  535.  
  536.   0 =  0
  537.   1 =  1
  538.   2 =  2
  539.   3 =  3
  540.   4 =  4
  541.   5 =  5
  542.   6 =  6
  543.   7 =  7
  544.   8 =  8
  545.   9 =  9
  546.   A = 10
  547.   B = 11
  548.   C = 12
  549.   D = 13
  550.   E = 14
  551.   F = 15
  552.  10 = 16
  553.  
  554.   The right-most digit in a hexidecimal number is still the one's column,
  555. but instead of 10's, 100's and 1000's we have 16's, 256's, and 4096's.
  556. To convert a hexidecimal number to decimal, simply take the digit from each
  557. column and multiply by the columns value:
  558.  
  559.   A148 =    A * 4096     =   40960
  560.          +  1 *  256     =  +  256
  561.          +  4 *   16     =  +   64
  562.          +  8 *    1     =  +    8
  563.                            ~~~~~~~~~
  564.                             = 41288
  565.  
  566.  
  567.  Like I said, just a refresher.
  568.  
  569.  
  570. ----------------------------------------------------------------------------
  571. PROGRAMMING ROBOTS:
  572.  
  573.   When a program is loaded into AT-Robots, it undergoes a process called
  574. "compiling" where each number, word, and instruction is converted into a
  575. number. These numbers are called OP-CODES, or OPs for short. As you will
  576. see below, the compiler is extremely flexible, and you can get away with
  577. all sorts of bizarre combinations and still get a not only a clean compile,
  578. but also a functional robot program.
  579.  
  580. The programming language consists of several basic types of statements.
  581.  
  582. 1) Remarks.   - These are not compiled into your program, they are simply
  583.                 notes that you can read when viewing programs. Use these
  584.                 to put comments in about what the program is doing, to make
  585.                 it more understanable when looking through it.
  586. 2) Directives - These are used exclusively by the compiler, and are not
  587.                 executed at run-time. The best examples are Var Defs (#def)
  588. 3) Labels.    - These are the target locations for JUMP/GOTO and GOSUB/CALL
  589.                 commands. They are not executed and do not use your robots
  590.                 processor time.
  591. 4) Commands.  - These are the functions of your robot. They command the robot
  592.                 to perform specified activities.
  593. 5) Variables  - You can have up to 256 variables. They are 16 bits (holding
  594.                 a value from -32768 to 32767). Their names must contain only
  595.                 letters, numbers, and underscores, and must begin with a
  596.                 letter. NO symbol-characters! A variable name can be up to
  597.                 16 characters long.
  598.  
  599.  
  600.   The word "Instruction" will often be using in place of "Command". Also note
  601. that "registers" are simply special cases of variables.
  602.  
  603. Now for more detail on these types of statements...
  604.  
  605. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  606. STATEMENTS:
  607.  
  608.  
  609. Remarks: 
  610.  
  611.   Syntax:
  612.           ;      <statement>
  613.      The semi-colon MUST come before the comments/remarks on a line, and
  614.    whatever you put on the line after it will be ignored by the
  615.    compiler.
  616.    OP-CODE: none, ignored
  617.  
  618.  
  619. Indirect (colon) Labels:
  620.  
  621.   Syntax: 
  622.           :####
  623.      The colon MUST be the FIRST character on the line (except for spaces).
  624.    RIGHT after it, without any spaces in-between, you put a number anywhere
  625.    from 0 to 32767. That number is the label. Do not use the same number
  626.    twice within the same program. You can not use a hexidecimal number in
  627.    a label.
  628.    OP-CODE: <label number>
  629.  
  630.  
  631. Direct (exclamation) Labels:
  632.  
  633.   Syntax:
  634.           !####
  635.      The exclamation mark  MUST be the FIRST character on the line (except
  636.    for spaces).  RIGHT after it, without any spaces in-between, you put an
  637.    identifier, be it a word or a number. Unlike the colon labels, these
  638.    are not compiled into the program, but rather a note is made of the
  639.    position within the program to use as a destination for jumps, etc.
  640.    OP-CODE: <none>
  641.  
  642.  
  643. Commands/Instructions:
  644.  
  645.   Syntax: 
  646.           Command [parameters]
  647.      The command may or may not have parameters, but if there are, you 
  648.    seperate them from the command with spaces, tabs, or commas. Only one
  649.    instruction may be put on each line. 
  650.    OP-CODE: defined on chart below.
  651.  
  652.  
  653. Variable Definitions:
  654.  
  655.   Syntax:
  656.         #def <variable name>
  657.      The definition MUST come BEFORE the first time the variable is used
  658.    in the program. Don't worry about putting the definitions inside loops,
  659.    or after the program starts, these can be put just about anywhere, and 
  660.    are not compiled into the program. They are used to figure out how to 
  661.    compile the program, but do not get turned into executable code.
  662.    OP-CODE: none, used by compiler only to assign memory addresses.
  663.  
  664.  
  665. Variables:
  666.  
  667.      Once a variable has been declared, it can be used anywhere in the 
  668.    program any way you like. The compiler is VERY flexible. All the things 
  669.    you can get away with are described later, but remember, you can do just 
  670.    about anything with these suckers..
  671.    OP-CODE: <mem address>
  672.  
  673.  
  674. Pre-compiled Machine Code:
  675.  
  676.   Syntax:
  677.           *N1,N2,N3,N4
  678.      Normally you can enter direct numeric codes for memory locations
  679.    and instructions. However, these still require you to use brackets and
  680.    '@'/'!' symbols in order for the microcode to be set up correctly. This
  681.    directive instructs the compiler to directly enter 4 numbers in as an
  682.    instruction in the program, much like the 'db' statement in PC assembly.
  683.    These numbers can be decimal or hexidecimal, and must be seperated by
  684.    spaces or commas or any of the other usual white-space characters. The
  685.    left-most number is the instruction, the right-most is the microcode.
  686.    For details on how the microcode works, you'll really need to look at
  687.    the simulator's source code, since no detail will be given here. It is
  688.    not recommended that you use pre-compiled code in your programs. However,
  689.    this option has been included to add flexibility for those who wish to
  690.    write third-party programs, such as genetic robot-evolving programs.
  691.  
  692.  
  693. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  694. COMPILER DIRECTIVES:
  695.  
  696.   The most important compiler directives are variable definitions, which
  697. are shown above. Here are the others currently implemented:
  698.  
  699.   #TIME <number>     - Specifies the maximum timeslice for the robot.
  700.                        If higher than the current robot timeslice that
  701.                        the game is using, it will not speed up your robot
  702.                        to give it an unfair advantage. This simply sets
  703.                        a limit, so that your robot will not execute its
  704.                        program any faster than this. i.e. TIME 5 means that
  705.                        the robot will never execute more than 5 CPU cycles
  706.                        per game cycle, no matter how high the timeslice
  707.                        setting is.
  708.  
  709.   #MSG <message>     - This displays a message in the robot's display area.
  710.                        Currently, the message may be 31 characters long,
  711.                        but only 19 will be shown in the display area. Since
  712.                        this is a compiler directive and not a run-time
  713.                        instruction, your robot may only have one overall
  714.                        message.
  715.  
  716.   #CONFIG <config>   - This directive assigns a point-value to a given
  717.                        device in your robot's body. By manipulating these,
  718.                        you can create a wide-range of configurations to
  719.                        custom-tweek your robot to suit your tactics. The
  720.                        configuration options you can use are in the section
  721.                        below entitled "ROBOT CONFIGURATIONS".
  722.  
  723.  
  724.   Remember that these are COMPILER instructions. They are executed at
  725. compile-time and not at run-time. Therefore the LAST one of each
  726. specified in the robot is the one that will be used throughout the
  727. simulation. You can not have multiple #MSG's that let you know what
  728. the robot is doing at different points in the program (text strings
  729. can not be stored in compiled robot programs).
  730.  
  731.   All versions of AT-Robots-2 simply ignore (without an error) any
  732. unknown directives, so using them will not make your robot useless on
  733. earlier versions of ATR2. This allows new configs to be added easily
  734. and still maintain downward compatibility.
  735.  
  736.  
  737. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  738. ROBOT CONFIGURATIONS:
  739.  
  740.   Your robot has many devices at its command, such as a scanner, a weapon,
  741. and an engine. You can adjust these devices, and change the emphasis in
  742. your robot's design to custom-tweek it to suit your particular choice of
  743. tactics. There are also some devices that can be added to your robot that
  744. it would not otherwise have. These adjustments are made using the compiler
  745. directive called "config".
  746.  
  747. For example:     #config scanner=1  ; This reduces scan range to 350 meters.
  748.  
  749.   By manipulating the number of points you have invested in each device,
  750. you can change the overall configuration of your robot. Here are the tables
  751. showing the effect and point-costs for each device:  (an asterisk (*) denotes
  752. the default value for each device)
  753.  
  754. Points   Scanner  Weapon    Armor    Engine  Heatsinks  Mines  Shield
  755. ------   -------  ------  ---------  ------  ---------  -----  ------
  756.    0       250     0.50   0.50,1.33   0.50     0.75       2*    None*
  757.    1       350     0.80   0.66,1.20   0.80     1.00*      4       -
  758.    2       500     1.00*  1.00,1.00*  1.00*    1.125      6       -
  759.    3       700     1.20   1.20,0.85   1.20     1.25      10     Weak
  760.    4      1000     1.35   1.30,0.75   1.35     1.33      16     Medium
  761.    5      1500*    1.50   1.50,0.66   1.50     1.50      24     Strong
  762.  
  763. Scanner:   This is the maximum range your scanner can see.
  764. Weapon:    A multiplier placed upon your missiles damage, speed, and heat.
  765. Armor:     Two multipliers:   1. Armor multiplier   2. Speed multiplier
  766. Engine:    This is the multiplier applied to your maximum speed.
  767. Heatsinks: Change in heat dissipation (multiplier).
  768. Mines:     This is the number of mines you start the battle with.
  769. Shield:    It takes at least 3 points to get one. Blocks damage
  770.  
  771.   Shield damage blocking:
  772.  
  773.   Weak:    2/3 damage gets through, and 2/3 converted to heat. (1/3 overlap)
  774.   Medium:  1/2 damage gets through, other half turned to heat.
  775.   Strong:  1/3 damage gets through, and 1/3 converted to heat.
  776.  
  777.  
  778. These multipliers are adjustments placed upon what the standard numbers
  779. would be. For instance, Heatsinks=5 will dissipate heat 50% faster than
  780. the default of Heatsinks=1.
  781.  
  782. You have a maximum of 12 points to allocate to all these systems and
  783. devices. You can total less than 12, but not more.
  784.  
  785. Note- The speed multipliers from the engine and armor are both factored
  786. into your maximum speed. However, the throttle is still percentage based,
  787. so Throttle 100 is still maximum speed. Same goes for your armor; 100% is
  788. still maximum armor. The armor difference is actually achieved by adjusting
  789. the damage taken rather than the total number of armor points.
  790.  
  791. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  792. REGISTERS:
  793.  
  794.   The ROS (Robot Operating System) has a series of several memory locations
  795. that are set aside for certain functions. They are called registers. They
  796. are used for various things, including interrupt parameters, loop control,
  797. and comparisons. The following are their most common uses and their memory
  798. locations and op-codes.
  799.  
  800.   Register:   Mem/Op:    Function:                            Name:
  801.   ~~~~~~~~~   ~~~~~~~    ~~~~~~~~~                            ~~~~~
  802.      Flags      64       Comparisons, conditional jumps.      Flags
  803.      AX         65       Interrupt instruction, general use   Accumulator
  804.      BX         66       General use                          Base Reg.
  805.      CX         67       Loop control                         Counter Reg.
  806.      DX         68       General use                          Data Register
  807.      EX         69       Returns from interrupt calls         Extended Reg.
  808.      FX         70       Returns from interrupt calls         Function Reg.
  809.      SP         71       Controls the stack.                  Stack Pointer
  810.  
  811.  
  812. FLAGS:
  813.  
  814.   Individual bits in the flags register have specific meanings:
  815.   R = Reserved, O = Open for your use
  816.  
  817.   Note that the lower nybble of the upper byte is available for your uses.
  818.  
  819.  15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00  Name:                Mask:
  820.   R  R  R  R  O  O  O  O  R  R  R  R  |  |  |  +- Equal flag     (eq)  0001h
  821.                                       |  |  +---- Less-than flag (lf)  0002h
  822.                                       |  +------- Grtr-than flag (gf)  0004h
  823.                                       +---------- Zero flag      (zf)  0008h
  824.  
  825.   Executing a CMP or a TEST changes the entire low nybble.
  826.  
  827.   CMP results:
  828.   ~~~~~~~~~~~~
  829.   Equal flag:    Set when operands are equal.
  830.   Greater flag:  Set when operand#1 > operand#2
  831.   Less flag:     Set when operand#1 < operand#2
  832.   Zero flag:     Set when operands are equal AND are 0.
  833.  
  834.   All comparisons are done as SIGNED values. That means 0xF000 < 0.
  835.  
  836.   Examples: (results show flags value in binary)
  837.  
  838.   CMP 1, 1   ; 0001
  839.   CMP 0, 1   ; 0010
  840.   CMP 1, 0   ; 0100
  841.   CMP 0, 0   ; 1001
  842.  
  843.   TEST results:
  844.   ~~~~~~~~~~~~~
  845.   Equal flag:    Set when operands are equal.
  846.   Zero flag:     Set when the binary "AND" of operands #1 & #2 = 0.
  847.  
  848.   After a TEST, the Greater flag and the Less flag are always 0.
  849.  
  850.   Examples: (results show flags value in binary)
  851.  
  852.   TEST 1, 1  ; 0001
  853.   TEST 0, 1  ; 1000
  854.   TEST 1, 0  ; 1000
  855.   TEST 0, 0  ; 1001
  856.  
  857.   Because the zero-flag is dependant on the "AND" result of the two operands,
  858. it is a good way to see if a bit is turned on. Let's say you want to look
  859. at the lowest USER bit in flags, the following code will TEST this bit.
  860.  
  861.    mov   ax, flags   ; make a copy of "flags", just to be safe
  862.                      ; since TEST will change "flags".
  863.    test  ax, 0100h   ; Test bit 8 (mask of 256 or 0100h)
  864.    jz    100         ; If bit is off, goto :100
  865.    jnz   200         ; If bit is on,  goto :200
  866.  
  867.  
  868. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  869. INSTRUCTIONS/COMMANDS:
  870.  
  871.   The instructions in a robot program tell the robot what to do. The
  872. following list shows their names, syntax, and how many CPU clock-ticks
  873. they require (some take longer than others to execute). The chart below
  874. is for your reference. To read a discussion about how to use them skip
  875. along.
  876.  
  877.   The parameters that come after an instruction are called operands, and
  878. sometimes they must be of specific types. The types are as follows:
  879.  
  880.  N = number, of any type. Could be a number or value from a variable.
  881.  V = variable, meaning it must be a variable, register, or memory access.
  882.  
  883.  In the chart header below, T refers to the time it takes to execute
  884. an instruction
  885.  
  886. Op: T: Name: Alt:    Syntax/Description:
  887. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  888.  0  1  NOP           NOP        Simply wastes a clock-cycle.
  889.  1  1  ADD           ADD V N    Adds      V+N, result stored in V
  890.  2  1  SUB           SUB V N    Subtracts V-N, result stored in V
  891. 33  1  INC           INC V      Increments V, (v=v+1)
  892. 34  1  DEC           DEC V      Decrements V, (v=v-1)
  893. 35  1  SHL           SHL V N    Bit-shifts  V left  N bit positions
  894. 36  1  SHR           SHR V N    Bit-shifts  V right N bit positions
  895. 37  1  ROL           ROL V N    Bit-rotates V left  N bit positions
  896. 38  1  ROR           ROR V N    Bit-rotates V right N bit positions
  897. 43  1  SAL           SAL V N    Bit-Shifts, same as SHL
  898. 44  1  SAR           SAR V N    Same as SHR, except preserves bit 15.
  899. 45  1  NEG           NEG V      Negates V:   V = 0-V  (aka "two's compliment")
  900.  3  1  OR            OR  V N    Bitwise OR,  V or  N, result stored in V
  901.  4  1  AND           AND V N    Bitwise AND, V and N, result stored in V
  902.  5  1  XOR           XOR V N    Bitwise XOR, V xor N, result stored in V
  903.  6  1  NOT           NOT V      Bitwise NOT, not(V),  result stored in V
  904.  7 10  MPY           MPY V N    Mulitplies V*N, result stored in V
  905.  8 10  DIV           DIV V N    Divides    V/N, result stored in V (integer)
  906.  9 10  MOD           MOD V N    MOD's    V & N, result stored in V (modulus)
  907. 10  1  RET  RETURN   RET        Returns from a subroutine (pops the ip)
  908. 11  1  CALL GSB      CALL N     Calls subroutine at label #N (pushes ip)
  909. 12  1  JMP  GOTO     JMP N      Jumps program (ip) to label #N
  910. 20  1  CMP           CMP N N    Compares two numbers, results in flags reg.
  911. 13  0  JLS  JB       JLS N      Jumps to label N if last compare was <
  912. 14  0  JGR  JA       JGR N      Jumps to label N if last compare was >
  913. 15  0  JNE           JNE N      Jumps to label N if last compare was <>
  914. 16  0  JEQ  JE       JEQ N      Jumps to label N if last compare was =
  915. 41  0  JAE  JGE      JAE N      Jumps to label N if last compare was >=
  916. 42  0  JBE  JLE      JBE N      Jumps to label N if last compare was <=
  917. 39  0  JZ            JZ  N      Jumps to label N if last compare was 0
  918. 40  0  JNZ           JNZ N      Jumps to label N if last compare was not 0
  919. 46  1  JTL           JTL N      Jumps to line N of compiled program.
  920. 17  3  XCHG SWAP     XCHG V V   Exchanges the values of two variables
  921. 18  1  DO            DO N       Sets CX = N
  922. 19  1  LOOP          LOOP N     Decrements CX, If CX>0 then Jumps to label N
  923. 21  2  TEST          TEST N N   Ands two numbers, result not stored, flags set
  924. 22  1  MOV  SET      MOV V N    Sets V = N
  925. 23  2  LOC  ADDR     LOC V V    Sets first V = memory address of second V
  926. 24  2  GET           GET V N    Sets V = number from memory location N
  927. 25  2  PUT           PUT N1 N2  Sets memory location N2 = N1
  928. 26  ?  INT           INT N      Executes interrupt number N
  929. 27  4+ IPO  IN       IPO N V    Inputs number from port N, result into V
  930. 28  4+ OPO  OUT      OPO N1 N2  Outputs N2 to port N1
  931. 29  ?  DEL  DELAY    DEL N      Equivelant to N NOPS.
  932. 30  1  PUSH          PUSH N     Puts N onto the stack (sp incremented)
  933. 31  1  POP           POP  V     Removes a number from the stack, into V
  934. 32  0  ERR  ERROR    ERR N      Generate an error code, useful for debugging
  935.  
  936.   Note that some instructions take 0 time to execute. This was done so as
  937. to not discourage making complex jump-lists. Note however that 0-time
  938. instructions made it theoretically possible to send the SIMULATOR into
  939. an endless loop if you specifically designed robots to do so. Therefore,
  940. if 20 0-time instructions are executed within a single game-cycle, they
  941. count as using 1 robot cpu cycle. There is also an implied NOP at the end
  942. of each program (so that 0-length programs are impossible).
  943.  
  944.   All comparisons, conditional jumps, and math functions are based on
  945. SIGNED 16-bit operations.
  946.  
  947.   JTL is the only jump instruction that does not assume the older, indirect,
  948. colon-prefix labels. You can use the newer, direct labels (exclamation-prefix)
  949. with ALL jumps, but if you wish to specify a program location by number,
  950. for which there is no label, you must use JTL.
  951.  
  952.   JTL jumps to the program line number specified as an operand. Remember
  953. that this uses COMPILED lines, with the counting 0-based (i.e. first
  954. program instruction is line 0). Indirect labels (:labels) also count
  955. as compiled lines.
  956.  
  957.   Just remember that you can only have 256 !labels.
  958.  
  959.   example:
  960.  
  961.         xor ax, ax    ; ax = 0,   this is position 0.
  962. !begin                ; label is at position 1, right after position 0.
  963.  
  964.         ;...   30 instructions and :labels have passed
  965.  
  966. !start                ; Let's assume this represents compiled line 30
  967.         XOR ax, ax    ; this is the actual line 30...  ax = 0
  968.  
  969.         JTL !start    ; Jump to !start
  970.         JMP !start    ; Also Jump to !start
  971.                       ;   (both cases are endless loops of ax=0)
  972.  
  973.                       ; Assuming we get past them magically...
  974.         mov ax, 1     ; ax = 1
  975.  
  976. :1                    ; Now we get to see the difference:
  977.         JTL ax        ; Jumps to position 1, which is at !begin
  978.         JMP ax        ; Jumps to :1, because all jumps other than JTL
  979.                       ;   assume the old :label system instead of the
  980.                       ;   newer !label system.
  981.  
  982.  
  983.   All of the conditional jumps work the same way as JMP above.
  984.  
  985.  
  986. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  987. PORTS:
  988.  
  989.   I/O ports are how your robot program accesses the various devices that
  990. the robot is equipped with. Each device is assigned a port number. It might
  991. be handy to have a print-out of this chart at the very least.
  992.  
  993.   If you have used ATR1, take notice that ports 1 through 17 remain the same.
  994.  
  995.   In the chart header below, once again T represents the time it takes to
  996. access the port in addition to the execution time for the port access
  997. instruction.
  998.  
  999. Num:  T:  I/O Name:             Function:
  1000. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1001.   1   0    I  Spedometer        Returns current throttle setting[-75- 100]
  1002.   2   0    I  Heat Sensor       Returns current heat-level       [0 - 500]
  1003.   3   0    I  Compass           Returns current heading          [0 - 255]
  1004.   4   0    I  Turret Sensor     Returns current turret offset    [0 - 255]
  1005.   5   0    I  Turret Sensor     Returns absolute turret heading  [0 - 255]
  1006.   6   0    I  Damage Sensor     Returns current armor level      [0 - 100]
  1007.   7   1    I  Scanner           Returns range to nearest target in scan arc
  1008.   8   1    I  Accuracy          Returns accuracy of last scan     [-2 - 2]
  1009.   9   3    I  Radar             Returns range to nearest target
  1010.  10   0    I  Random Generator  Returns random number     [-32768 - 32767]
  1011.  11   0    O  Throttle          Sets throttle                  [-75 - 100]
  1012.  12   0    O  Rotate Turret     Offsets turret (cumulative)
  1013.  13   0    O  Aim Turret        Sets turret offset to value      [0 - 255]
  1014.  14   0    O  Steering          Turn specified number of degrees
  1015.  15   3    O  Weapon control    Fires weapon w/ angle adjustment  [-4 - 4]
  1016.  16  40    I  Sonar             Returns heading to nearest target[0 - 255]
  1017.  17   0   I/O Scan-Arc          Sets/Returns scan-arc width.      [0 - 64]
  1018.  18   0   I/O Overburn          Sets/Returns overburn status
  1019.  19   0   I/O Transponder       Sets/Returns current transponder ID
  1020.  20   0   I/O Shutdown-Level    Sets/Returns shutdown-level.
  1021.  21   0   I/O Com Channel       Sets/Returns com channel setting
  1022.  22   0   I/O Mine Layer        Lays mine or Returns mines-remaining.
  1023.  23   0   I/O Mine Trigger      Detonates/returns previously-placed mines.
  1024.  24   0   I/O Shield            Sets/Returns shield's status (0=off, else=on)
  1025.  
  1026.   Port 13, Aim-Turret, sets the turret offset to the value given. This is
  1027. an OFFSET, which means that it is RELATIVE to the robot body. (0 is straight
  1028. ahead, 128 is straight back, etc). Port 12 is similar, but it is a rotation
  1029. command, meaning that the turret rotates the specified number of degrees
  1030. (10 is 10 to the right, -10 or 246 is 10 to the left). Port 12 is therefore
  1031. much like the steering port (port 14).
  1032.  
  1033.   There is no port that allows you to set your turret to an absolute
  1034. compass heading. You will have to calculate this yourself. However, you
  1035. can access port 5 to GET your absolute turret heading (this is simply a
  1036. compass mounted on the turret). Port 4 returns the turret offset, which
  1037. once again is the heading of the turret relative to the robot body.
  1038.  
  1039.   The compass (port 3) returns your current absolute heading, which may
  1040. not yet have caught up with the last turn command.
  1041.  
  1042.   The spedometer (port 1) returns what your current velocity is relative
  1043. to your maximum. The maximum can be affected by heat level and overburn
  1044. status. i.e., setting your throttle to 100 will always cause the spedometer
  1045. to report 100 once the robot reaches full speed, unless you change the
  1046. throttle, shutdown, reset, or collide with something. Sending a negative
  1047. number to the throttle port (port 11) will make the robot drive backwards.
  1048.  
  1049.   The scan-arc is defined as being the number of degrees to EACH side of
  1050. the center of your scan. If you set your arc to 64, you actually get a
  1051. 128 total arc (half of the full circle!) (64 is the maximum).
  1052.  
  1053.   The scanner returns a very large number somewhere over 1500 (such as
  1054. MAXINT) if no target is found.
  1055.  
  1056.   The weapon can fire as much as 4 degrees in either direction without
  1057. turning the turret or the robot. If you leave off the final operand on
  1058. the port access, as usual a 0 is assumed and the weapon fires straight
  1059. ahead.
  1060.  
  1061.   The Sonar has a maximum range of 250. It returns a negative number if
  1062. no target is within range. Also notice that it is extremely slow to access.
  1063. It also has a poor accuracy. The number returned could be as far off as 32
  1064. degrees in either direction (equivelant of 45 degrees in a normal 360
  1065. degree circle). You'll notice that sonar is SO slow, and SO innacurate,
  1066. that it is almost useless. It is merely here to give you a simple method
  1067. to find the nearest target, yet encourage you to create your own search
  1068. routines with the scanner.
  1069.  
  1070.   When accessing the overburn port, 0=off, and anything non zero is on.
  1071.  
  1072.   Port 19, the transponder, simply sets or returns your robots ID number.
  1073. At the beginning of the battle, the transponder starts off being a number
  1074. from 1 to 6 depending on which "slot" your robot is taking up in the
  1075. simulation.
  1076.  
  1077.   Port 20, Shutdown-level, sets/returns the heat-level at which automatic
  1078. shutdown will ocurr. When the robot shuts down, it will remain so until
  1079. it cools down below the shutdown level minus 50 (default level is 400,
  1080. therefore the robot will start up again at 350), or when the heat
  1081. drops to 0.
  1082.  
  1083.   Ports 22 and 23 operate the mine-layer, if your robot is equipped with
  1084. one. Outputting to port 22 will cause the mine-layer to place a mine, if
  1085. it has any mines left. The number you output to the port will be used by
  1086. the mine as its detection radius. If set to 0, the mine will most likely
  1087. never go off, since it will require a robot to be perfectly centered over
  1088. it. 5 will require the robot to still get very close, but will do a great
  1089. deal of damage. Setting it to 15 or more may diminish the damage, but make
  1090. it much more likely to go off when a robot approaches. Reading from this
  1091. port (22) will give you the number of mines remaining in the mine-layer.
  1092. Writing to port 23 will detonate all of the mines you have placed in the
  1093. arena that have not already gone off. This is the only way to detonate
  1094. your own mines, since they're smart enough not to go off on you, only
  1095. on other robots. Reading from 23 will tell you how many such mines you
  1096. currently have in the battlefield.
  1097.  
  1098.   Port 24 is for the shield. If your robot is equipped with a shield, you
  1099. will use this port to operate it. The shield is an energy-field that prevents
  1100. the transfer of heat. Since the missiles are plasma-based, they typically
  1101. damage the robot by burning it. The plasma also causes the robot firing the
  1102. missile to generate a lot of heat that must be dissipated. With the shield
  1103. raised, your robot will be less exposed to attacks via mines or missiles (it
  1104. will not protect against physical damage, so collisions and overheating
  1105. internally still hurt you). However, since the shield blocks heat, your
  1106. robot will not be able to cool itself at all while the shield is in use.
  1107. Unfortunately, the shield itself generates heat slowly as well, so you can
  1108. not use it indefinitely. Writing a 0 to port 24 will lower the shield, any
  1109. other number will turn it on. Reading from the port will return a 0 if the
  1110. shield is off, or a non-zero number if it is on.
  1111.  
  1112.  
  1113. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1114. INTERRUPT CALLS:
  1115.  
  1116.   In addition to I/O ports, the robot is equipped with some built-in 
  1117. functions that can be used. These functions are called interrupts. In your 
  1118. programs you can use the INT command to execute an interrupt. When you call 
  1119. an interrupt, you will often need to set some of the system registers before 
  1120. executing it, to tell it what to do.
  1121.  
  1122.   Unlike in ATR1, you can not specify your own interrupt vectors. Also,
  1123. all of the interrupts have been redefined and are not the same as they
  1124. were in ATR1.
  1125.  
  1126.   In the chart header below, once again T represents the time it takes to
  1127. execute the interrupt call, although unlike with the ports, this is the
  1128. total time usage.
  1129.  
  1130. Num: T: Name:        Function:
  1131. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1132.   0   - Destruct     Detonate the robot (if I go down, you go down with me!)
  1133.   1  10 Reset        Resets robot program.
  1134.   2   5 Locate       Sets EX,FX registers equal to X,Y coordinates.
  1135.   3   2 Keepshift    Sets Keepshift, input:     AX 0 = off, non-0 = on
  1136.   4   1 Overburn     Sets Overburn,  input:     AX 0 = off, non-0 = on
  1137.   5   2 ID           Returns robot ID number in FX
  1138.   6   2 Timer        Returns game clock in EX:FX (32-bit number)
  1139.   7  32 Find Angle   Returns angle to point specified in EX,FX; AX=result
  1140.   8   1 Target-ID    Returns ID of last robot scanned (with any scan) in FX
  1141.   9   2 Target-Info  Returns info on last scanned target (EX=dir,FX=throttle)
  1142.  10   4 Game-Info    Returns info: DX=Total number of robots active,
  1143.                                    EX=Match number,
  1144.                                    FX=Number of matches
  1145.  11   5 Robot-info   Returns info: DX=Robot speed (in cm per game-cycle),
  1146.                                    EX=Time since last damage taken
  1147.                                    FX=Time since a fired shot hit a robot.
  1148.                                    (time measured in game-cycles)
  1149.                                    (robot speed is current as of int call)
  1150.  12   1 Collisions   Returns collision count in FX
  1151.  13   1 Reset ColCnt Resets collision count back to 0.
  1152.  14   1 Transmit     Transmits the data in AX on the current channel.
  1153.  15   1 Receive      Returns the next item in com queue in FX
  1154.  16   1 DataReady    Returns the amount of data in queue in FX (0 for none).
  1155.  17   1 ClearCom     Empties the Com Queue
  1156.  18   3 Kills/Deaths Returns info: DX=Kill Count (spans multiple rounds)
  1157.                                    EX=Kill Count (for this round only)
  1158.                                    FX=Deaths     (spans multiple rounds)
  1159.  19   1 ClearMeters  Resets the 'meters' variable to 0.
  1160.  
  1161.   Keepshift, when active, makes it so that whenever the robot body turns,
  1162. the turret turns by the same amount in the opposite direction, thus the
  1163. turret always faces the same way relative to the arena.
  1164.  
  1165.   Int 5 returns your current transponder ID, as described in the PORTS
  1166. section.
  1167.  
  1168.   The timer call returns the 32-bit game clock value. Since everything in
  1169. the game is handled as signed numbers, the next value above 32767 is -32768,
  1170. therefore you can only reliably access the clock for 32767 cycles into the
  1171. game. Most battles are completed in less than 10000 cycles though. EX holds
  1172. the upper 16 bits, and FX holds the lower 16 bits of the clock value.
  1173.  
  1174.   Interrupt 7 is very slow to execute, since it is basically doing a
  1175. trigonometric function. You put the X,Y coordinates you want into EX,FX,
  1176. call the int, and afterwards AX will hold the heading you should take to
  1177. get there. If you specify numbers outside the range of 0-1000, they will
  1178. be truncated into this range before the calculation is performed (i.e.
  1179. calling as EX=12345, FX=-500 will return the results for EX=1000, FX=0).
  1180.  
  1181.   Interrupt 8 will return whatever transponder ID the target robot has
  1182. set.
  1183.  
  1184.   Interrupt 9 returns info on the last target scanned using the primary
  1185. scanner (port 7). The direction of the target (relative to your scan) is
  1186. returned in EX (i.e. 64 means it is facing to the right of your scan and 0
  1187. means it is facing the same way you are scanning, which of course is away
  1188. from you). FX returns the targets current throttle (not the "desired 
  1189. throttle"), so that you may make some assesments of where it is going and 
  1190. how quickly.
  1191.  
  1192.   Interrupt 11 has a nice feature, being able to tell how recently you've
  1193. actually hit someone. This can facilitate making robots that can realize
  1194. they're not hitting anything.
  1195.  
  1196.   Interrupts 12 and 13 allow you to easily detect collisions, without
  1197. relying on your spedometer or damage totals to tell you these things
  1198. (especially considering that if you were already sitting still, and
  1199. someone rammed you very slowly, there would be no other way to know that
  1200. a collision ocurred). Int 12 simply returns the collision-count value
  1201. that is stored in memory location @8. This value is incrememnted everytime
  1202. a collision ocurrs, so any time it has changed you have been involved in
  1203. a collision, whether it was robot-to-robot or robot-to-wall. Int 13 resets
  1204. it back to zero, so that you could have some simple code that simply
  1205. checks to see if the count is non-zero (and hence a collision has ocurred
  1206. since the last reset with int 13).
  1207.  
  1208.   Interrupts 14 through 16 deal with the robot's communications system.
  1209. Using interrupt 14 will transmit whatever integer is stored in AX to all
  1210. robots tuned to the same channel. When the data is received by a robot,
  1211. it is put into a queue stored in memory. If the queue overflows, no error
  1212. will be generated- instead the oldest piece of data will be lost in favor
  1213. of the new data. Since the queue can hold 255 integers, a robot that doesn't
  1214. check the queue often enough will always have the most recent 255 integers
  1215. of data to be received. Interrupt 15 removes a piece of data from the
  1216. queue, and puts it into FX. Interrupt 16 tells how much data is currently
  1217. in the queue and waiting to be extracted. The channel can be set using a
  1218. port access.
  1219.  
  1220.  
  1221. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1222. MEMORY MAP:
  1223.  
  1224.   The robot's memory core has 1024 memory locations, each storing a 16-bit
  1225. integer value. When the robot is initialized, all memory addresses store
  1226. a zero.
  1227.  
  1228.   The first 128 addresses are the system area. You can define up to 256
  1229. variables, which are stored right after the system area. The remaining 128
  1230. memory locations are available for you to do whatever else you want, such
  1231. as storing self-modifying code (if you are up to such a nasty challenge!)
  1232. (self-modifying code may become more practical in later revisions, for now
  1233. though you would have to have all of the instructions set up as memory
  1234. assignments, like follows:   @384 @385, @386 ; rewritable instruction #1)
  1235.  
  1236.   Each memory location stores 16 bits, as stated above. A signed 16 bit
  1237. number can be in the range of -32768 to 32767. If you look at it as a
  1238. hexidecimal number, you will ignore the "sign" of the number. If it were
  1239. unsigned, it would appear to have a range of 0 to 65535, or in hexidecimal
  1240. 0000h to FFFFh.
  1241.  
  1242. Memory map:
  1243.  
  1244.  Addr:       Name:       Function:
  1245.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1246.     0        Dspd        Desired speed robot is trying to achieve.
  1247.     1        Dhd         Desired heading robot is trying to achieve.
  1248.     2        tpos        Current turret offset
  1249.     3        acc         accuracy value from last scan
  1250.     4        swap        temporary swap space used by swap/xchg instruction
  1251.     5        tr-id       ID of last target scanned (by any scan).
  1252.     6        tr-dir      Relative heading of last target scanned.
  1253.     7        tr-spd      Throttle of last target scanned.
  1254.     8        ColCnt      Collision count.
  1255.     9        Meters      Meters travelled. 15 bits used.. (32767+1)=0
  1256.    10        ComBase     Current base of the communications queue
  1257.    11        ComEnd      Current end-point of the communications queue
  1258.    13        tr-vel      Absolute speed (cm/cycle) of last target scanned
  1259.  14-63       res         reserved
  1260.    64        flags       flags register
  1261.    65        ax          ax register
  1262.    66        bx          bx register
  1263.    67        cx          cx register
  1264.    68        dx          dx register
  1265.    69        ex          ex register
  1266.    70        fx          fx register
  1267.    71        sp          stack pointer
  1268.  72-95       res         reserved for future registers
  1269.  96-127      res         reserved
  1270. 128-384      var         variable space
  1271. 385-511      user        user space
  1272. 512-767      com-queue   Communications receiving queue
  1273. 768-1023     res         Reserved space
  1274. 1024...      code        Robot program (code segment) (ROM)
  1275.  
  1276.   Please note that the first 4 memory locations make for an easy and
  1277. effective way to get info about your robot's status. Robots can be made
  1278. to be more efficient by accessing these. However, these are here ONLY for
  1279. getting info about the robot. If you try changing these values, it will have
  1280. no effect. To actually cause the robot to turn or whatever, you must still
  1281. access the appropriate ports.
  1282.  
  1283.   The robot's program is technically not stored in the robot's RAM, but
  1284. rather is in the robot's ROM along with the robot's BIOS (which handles
  1285. the interrupt calls).
  1286.  
  1287.   You can now access the robot program as though it were in RAM, starting
  1288. at address 1024. Please remember though that you can not jump or RET or
  1289. anything below 1024. As far as the robot's IP (instruction pointer) is
  1290. concerned, memory address 1024 is instruction address 0.
  1291.  
  1292.  
  1293. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1294. CONSTANTS:
  1295.  
  1296.   As you will see described further down under "writing the code",
  1297. the instructions are nothing more than pre-defined constants representing
  1298. numbers. Here is a chart of all of the pre-defined constants that you can
  1299. use in your programs, so that you don't have to memorize port and interrupt
  1300. numbers.
  1301.  
  1302. Value:      Mnemonic:   Port-Constant:  Interrupt-Constant:  Generic Constant:
  1303. -32768                                                           MININT
  1304.  32767                                                           MAXINT
  1305.   0          NOP                                  I_DESTRUCT
  1306.   1          ADD          P_SPEDOMETER            I_RESET
  1307.   2          SUB          P_HEAT                  I_LOCATE
  1308.   3          OR           P_COMPASS               I_KEEPSHIFT
  1309.   4          AND          P_TURRET_OFS            I_OVERBURN
  1310.   5          XOR          P_TURRET_ABS            I_ID
  1311.   6          NOT          P_DAMAGE, P_ARMOR       I_TIMER
  1312.   7          MPY          P_SCAN                  I_ANGLE
  1313.   8          DIV          P_ACCURACY              I_TID, I_TARGETID
  1314.   9          MOD          P_RADAR                 I_TINFO, I_TARGETINFO
  1315.  10          RET          P_RANDOM, P_RAND        I_GINFO, I_GAMEINFO
  1316.  11          GSB, CALL    P_THROTTLE              I_RINFO, I_ROBOTINFO
  1317.  12          JMP, GOTO    P_OFS_TURRET, P_TROTATE I_COLLISIONS
  1318.  13          JLS, JB      P_ABS_TURRET, P_TAIM    I_RESETCOLCNT
  1319.  14          JGR, JA      P_STEERING              I_TRANSMIT
  1320.  15          JNE          P_WEAP, P_WEAPON,P_FIRE I_RECEIVE
  1321.  16          JEQ, JE      P_SONAR                 I_DATAREADY
  1322.  17          XCHG, SWAP   P_ARC, P_SCANARC        I_CLEARCOM
  1323.  18          DO           P_OVERBURN              I_KILLS, I_DEATHS
  1324.  19          LOOP         P_TRANSPONDER           I_CLEARMETERS
  1325.  20          CMP          P_SHUTDOWN
  1326.  21          TEST         P_CHANNEL
  1327.  22          SET, MOV     P_MINELAYER
  1328.  23          LOC          P_MINETRIGGER
  1329.  24          GET          P_SHIELD,P_SHIELDS
  1330.  25          PUT
  1331.  26          INT
  1332.  27          IPO, IN
  1333.  28          OPO, OUT
  1334.  29          DEL, DELAY
  1335.  30          PUSH
  1336.  31          POP
  1337.  32          ERR, ERROR
  1338.  33          INC
  1339.  34          DEC
  1340.  35          SHL
  1341.  36          SHR
  1342.  37          ROL
  1343.  38          ROR
  1344.  39          JZ
  1345.  40          JNZ
  1346.  41          JAE, JGE
  1347.  42          JBE, JLE
  1348.  43          SAL
  1349.  44          SAR
  1350.  45          NEG
  1351.  46          JTL
  1352.  
  1353.  
  1354. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1355. WRITING THE CODE:
  1356.  
  1357.   Ok, now that you've seen the reference charts, how 'bout learning the
  1358. syntax of the language, and a few of the subtleties? Below is a crash course,
  1359. emphasizing CRASH. It is assumed that you have some familiarity with
  1360. programming concepts. Even though the explanations start out being
  1361. extremely basic, it gets into the more specific nuances of the language
  1362. very quickly. Everything else you may need to teach yourself, perhaps
  1363. through trial and error.
  1364.  
  1365.   Every command line consists of an instruction (sometimes called a
  1366. command, or an operator), and usually one or two operands. The compiler
  1367. is not too picky about what is used where, so most things are interchangable.
  1368. Also remember that capitalization is totally irrelevant.
  1369.  
  1370.   Let's look at an example:
  1371.  
  1372.   Add   ax,  2
  1373.  
  1374.   This takes the value in the register AX, adds 2, then stores it
  1375. back into the AX register.
  1376.  
  1377.   You can create remarks/comments by using the semi-colon. From now on
  1378. you will see comments next to the instructions explaining them.
  1379.  
  1380.         Add     ax,      2      ; ax = ax+2
  1381.  
  1382.   If you wish, you can use loop commands to repeat something
  1383. several times:
  1384.  
  1385.         do      5               ; cx = 5
  1386. :1
  1387.         add     ax,     2       ; ax = ax+2
  1388.         loop    1               ; decrement cx, if >0 goto :1
  1389.  
  1390.   In this previous example, it would have the effect of simply
  1391. adding 10 (2 added 5 times) to AX. Make sure the loop is structured
  1392. properly though. Here is what NOT to do:
  1393.  
  1394. :1
  1395.         do      5               ; cx = 5
  1396.         add     ax,     2       ; ax = ax+2
  1397.         loop    1               ; decrement cx, if >0 goto :1
  1398.  
  1399.   In this past example, CX is reset to 5 everytime through the loop,
  1400. therefore never reaching 0. What you have is an infinite loop. Of course,
  1401. making infinite loops is easy:
  1402.  
  1403. :1
  1404.         jmp     1
  1405.  
  1406.   Or to make it a little more wierd, try it this way:
  1407.  
  1408.         mov  ax,  1
  1409. :1
  1410.         jmp  ax
  1411.  
  1412.   Or you can make it even more weird:
  1413.  
  1414.         mov  ax,  70      ; AX = address of FX
  1415.         mov  fx,  1       ; FX = 1
  1416. :1
  1417.         jmp  [ax]         ; Jump to line label specified in FX.
  1418.  
  1419.  
  1420.   To put a specific number into a variable/register, simply
  1421. use SET/MOV:
  1422.  
  1423.         mov     ax,     15      ; ax = 15
  1424.  
  1425.   Or you could use the memory address:
  1426.  
  1427.         mov    @65,    15       ; ax = 15
  1428.  
  1429.   Or copy a variable:
  1430.  
  1431.         mov    @65,    @66      ; ax = bx
  1432.         mov    ax,     bx       ; ax = bx
  1433.         mov    [65],   [66]     ; ax = bx
  1434.  
  1435.   In this past example, as far as the compiler is concerned, the first two
  1436. lines are identical. Variable names simply get replaced with the addresses
  1437. that they represent. For that matter, so do the instructions themselves,
  1438. as you will see further down. The third line has the same result, but is
  1439. compiled slightly differently.
  1440.  
  1441.   You can also use indirect addressing:
  1442.  
  1443.         mov    bx,     70       ; bx = 70 (the memory location for FX)
  1444.         mov    ax,     [bx]     ; ax = fx
  1445.  
  1446.   Now let's look at how you would define your own variable:
  1447.  
  1448. #def x
  1449. #def my_var
  1450.  
  1451.         xor     x,      x       ; x = 0 (anything xor'ed with itself is 0)
  1452.         mov     my_var, x       ; my_var = x (and therefore equals 0)
  1453.  
  1454.   Now, as stated above, the instructions are nothing more than words that
  1455. represent numbers, just like everything else:
  1456.  
  1457.        add      ax,     ax      ; ax = ax+ax (in other words, ax = ax*2)
  1458.        1        ax,     ax      ; Same thing! (add = 1)
  1459.        1        @65     @65     ; Same thing!!
  1460.  
  1461.   In fact, you can use variables in place of instructions:
  1462.  
  1463. #def inst
  1464.  
  1465.         mov     inst,   1       ; inst = 1
  1466.         inst    @65,    @65     ; same as "ADD AX, AX"
  1467.  
  1468.   If you leave off an operand, a 0 is assumed:
  1469.  
  1470.         mov     ax              ; ax = 0
  1471.  
  1472.   If you execute an interrupt this way, you get an interesting effect:
  1473.  
  1474.         int                     ; call int #0, kaboom! farewell cruel world!
  1475.  
  1476.   You could make a destruct deciding routine that would simply change a
  1477. variable. INT is 26, by the way
  1478.  
  1479.         xor     dx,     dx      ; dx = 0
  1480.  
  1481.         ipo     6,      armor   ; armor = armor value from armor sensor
  1482.         cmp     armor,  10      ; campare armor to 10
  1483.         ja      1000            ; if greater than 10, skip to :1000
  1484.         je      2000            ; if equal to 10, skip to :2000
  1485.         mov     dx,     26      ; dx = 26
  1486. :1000
  1487.         dx                      ; if dx=26 then kaboom! if 0, then nothing.
  1488. :2000
  1489.  
  1490.   You can also use the stack to store numbers if it is convenient:
  1491.  
  1492.         push    ax              ; put ax on the stack.
  1493.         pop     bx              ; pop a number off the stack into bx,
  1494.                                 ;    since the last thing pushed was ax,
  1495.                                 ;    whatever was in ax is now in bx.
  1496.  
  1497.   Be careful with the stack though, since it is the same stack used for
  1498. CALL/GOSUB/GSB and RET instructions. If you use PUSH and POP in a subroutine,
  1499. be sure to pop everything back off before you use RET.
  1500.  
  1501. :1
  1502.         CALL    1000    ; call subroutine at :1000
  1503.         jmp     1       ; loop back to :1, thus endlessly repeating the CALL
  1504.  
  1505. :1000
  1506.         opo     15      ; FIRE! (Output to port 15 fires weapon)
  1507.                         ;   no second operand, so 0 is assumed. Fire straight.
  1508.                         ;   (weapon can fire up to 4 degrees off center)
  1509.         ret             ; return to source of CALL.
  1510.  
  1511.   As shown above, you can easily create subroutines, which of course
  1512. facilitate making code that you can access from multiple places in the
  1513. program, and still have it always return to where you called it from.
  1514.  
  1515.   Now let's discuss nested loops. Since CX is used for loops, CX has to
  1516. be temporarily stored elsewhere during inner loops:
  1517.  
  1518.         DO      5               ; cx = 5
  1519. :1
  1520.         opo     13,     8       ; turn turret 8 degrees right
  1521.  
  1522.         mov     bx,     cx      ; bx = cx
  1523.         DO      5               ; cx = 5
  1524. :2
  1525.         opo     15              ; fire!
  1526.  
  1527.         LOOP    2               ; loop up to :2
  1528.         mov     cx,     bx      ; cx = bx
  1529.  
  1530.         LOOP    1               ; loop up to :1
  1531.  
  1532.   This would fire the weapon 25 times, 5 times at each angle. Perhaps
  1533. a better and less confusing method would be to use PUSH and POP, that way
  1534. we don't accidently screw up by doing something with bx.
  1535.  
  1536.         DO      5               ; cx = 5
  1537. :1
  1538.         opo     13,     8       ; turn turret 8 degrees right
  1539.  
  1540.         push    cx              ; put cx on stack
  1541.         DO      5               ; cx = 5
  1542. :2
  1543.         opo     15              ; fire!
  1544.  
  1545.         LOOP    2               ; loop up to :2
  1546.         pop     cx              ; get cx from stack
  1547.  
  1548.         LOOP    1               ; loop up to :1
  1549.  
  1550.  
  1551.   Also keep in mind how long it takes to do something. The following
  1552. three instructions all double the value of ax.
  1553.  
  1554.         MPY     ax,     2       ; ax = ax*2           time used: 10
  1555.         shl     ax,     1       ; ax = ax shl 1       time used: 1
  1556.         add     ax,     ax      ; ax = ax + ax        time used: 1
  1557.  
  1558.   Also compare these two:   (both quadruple AX)
  1559.  
  1560.         MPY     ax,     4       ; ax = ax*4           time used: 10
  1561.         shl     ax,     2       ; ax = ax shl 2       time used: 1
  1562.  
  1563.   Also note that by breaking any multiplication or division down into
  1564. powers of two you can also exectute fast math. For instance, a multiply
  1565. by 3 takes 10 clock cycles. The following example uses only 3, and achieves
  1566. the same result:
  1567.  
  1568.         MPY     ax,     3       ; ax = ax*3   (10 cpu cycles)
  1569.        ; or try the following instead
  1570.         MOV     bx,     ax      ; bx = ax       (1 cpu cycle)
  1571.         SHL     ax,     1       ; ax = ax * 2   (1 cpu cycle)
  1572.         ADD     ax,     bx      ; ax = ax + bx  (1 cpu cycle)
  1573.                                 ; net result is:  ax = (ax*2)+ax
  1574.                                 ;             or  ax = ax*3
  1575.  
  1576.   Please note however that bit shifts don't work so reliably with very
  1577. large numbers or negative numbers.
  1578.  
  1579.   Now that you've seen how to do loops, and some of the slick little
  1580. tricks you can use, I'll end this segment by mentioning the use of the
  1581. pre-defined constants to help with all those confusing port numbers.
  1582. Back with the other charts you will find a chart of these constants, and
  1583. below are a few examples:
  1584.  
  1585.         opo     p_fire          ; same as "opo 15"   - FIRE!
  1586.  
  1587.         p_spedometer   ax, ax   ; same as "1 ax ax" or "add ax ax"
  1588.  
  1589.  
  1590.   I hope that was enough to get you started. Believe me, if you can do
  1591. this stuff (and this isn't too hard), then you've tackled the basics
  1592. necessary for doing REAL programming in assembly on the PC. Just remember
  1593. that the PC is not as forgiving as ATR2!
  1594.  
  1595.   Now don't go away yet! Below are the error codes your robot might
  1596. generate...
  1597.  
  1598. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1599. ERRORS:
  1600.  
  1601.   Your robots should never generate a runtime error (either in terms of the
  1602. robot, OR the main game itself, but in this case we mean in terms of the 
  1603. robot). If they do make one, and you have the graphics and status bars turned
  1604. on, you'll be made aware of it. If the sound is on, then you'll hear it as 
  1605. well. If you have the graphics on, the bottom row of the status display
  1606. shows the last error code genereated by your robot. If your robot works
  1607. properly, and you aren't using the ERR command, it should always be "None".
  1608.  
  1609.   When a robot has a runtime error, the program will continue on and simply
  1610. not do the command that created the error. Note that the command that had
  1611. the error STILL uses your robot's time.
  1612.  
  1613.   If you use the ERR instruction to output info, you might want to display
  1614. numbers that aren't listed below, so you can tell the difference between
  1615. your error and a real robot error.
  1616.  
  1617. Here are the error codes:
  1618.  
  1619. Code:  Meaning:
  1620.   1     Stack full - This means that you have used too many PUSHes and/or
  1621.                      CALL/GOSUB/GSB commands without using the appropriate
  1622.                      POPs and RETs. This is a common problem for novice
  1623.                      programmers.
  1624.  
  1625.   2     Label not found - This means you're trying to jump or call or
  1626.                           something to a label that does not exist. Go
  1627.                           make sure all of the labels you call actually
  1628.                           exist somewhere. If you are using JTL, the
  1629.                           location you are jumping to is outside of
  1630.                           the program.
  1631.  
  1632.   3     Can't assign value - This means you're trying to store the result
  1633.                              of an operation into something that is not
  1634.                              a variable of some sort. Maybe you got the
  1635.                              operand order confused on an IPO command.
  1636.  
  1637.   4     Illegal memory reference - You're accessing a memory address that
  1638.                                    does not exist! Remember, there are only
  1639.                                    so many memory addresses in your robot!
  1640.  
  1641.   5     Stack empty - This is the reverse of error #1, meaning you're calling
  1642.                       too many POPs and RETs compared to your use of PUSH and
  1643.                       GOSUB/CALL/GSB commands. This is a much less likely
  1644.                       mistake to make.
  1645.  
  1646.   6     Illegal instruction - Hey! Trying to invent a new instruction eh?
  1647.                               This error ocurrs when you try to execute an
  1648.                               instruction that does not exist. If you program
  1649.                               with actual instruction mnemonics instead of
  1650.                               using variables and numbers in their place you
  1651.                               will not get this error, unless you redefine
  1652.                               a mnemonic as a variable.
  1653.  
  1654.   7     Return out of range - Your RET command yielded a number that is
  1655.                               outside your program. You must have called
  1656.                               a RET when the last thing still on the stack
  1657.                               was PUSHed there.
  1658.  
  1659.   8     Divide by ZERO  - You executed a DIV or MOD instruction with
  1660.                           the second operand being a 0. 
  1661.  
  1662.   9     Unresolved !label - You should never see this happen. No unresolved
  1663.                             !labels should make it past the compiler.
  1664.  
  1665.  10     Invalid Interrupt Call - This simply means that the interrupt
  1666.                                  you are trying to call does not exist.
  1667.  
  1668.  11     Invalid Port Access - Either the port you are accessing does not
  1669.                               exist, or you are writing to an input port,
  1670.                               or you are reading from an output port.
  1671.  
  1672.  12     Com Queue empty - You're trying to receive data when there's none
  1673.                           to receive. You should use Int 16 to check for
  1674.                           data ready.
  1675.  
  1676.  13     No mine-layer - You're attempting to access mine-layer functions
  1677.                         but you don't have a mine-layer installed. You
  1678.                         won't get this error just checking to see if you
  1679.                         have mines on-board though.
  1680.  
  1681.  14     No mines left - You're trying to place mines, when in fact you've
  1682.                         run out of them.
  1683.  
  1684.  15     No shield - You're attempting to use a shield but you don't have one.
  1685.  
  1686.  16     Invalid Microcode - Somehow your robot is trying to execute an
  1687.                             instruction with invalid microcode. This should
  1688.                             never happen, though it is possible if you put
  1689.                             inline machine-code in your programs.
  1690.  
  1691.  
  1692. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1693. DESIGNING THE PERFECT ROBOT:
  1694.  
  1695.   Ok, I'll bet you just glanced through the above information and are
  1696. thinking, "Ok, great. It looks nice, but how do I use it?" I hope to explain
  1697. a few details here, but I think the sample robot programs are by far the
  1698. best source of information. By looking through the samples robots, you can
  1699. pick up a few tricks and tips. Below are a few charts to refer back to at
  1700. later times, and a few general rules to go by. Afterwards is some more text
  1701. to help teach you about those strange little features that make the robots
  1702. so much more deadly, but require some understanding first.
  1703.  
  1704.   As you create your robot, you will want to first make sure it can handle
  1705. a stationary target. Afterwards you will want to slowly increase the
  1706. difficulty. Here is the order in which you should try some of the sample
  1707. robots as opponents:
  1708.  
  1709.    1. SDUCK
  1710.    2. CIRCLES
  1711.    3. TRACKER
  1712.    4. SNIPER and/or RANDMAN3
  1713.  
  1714.   General rules:
  1715.            1.  Try to make all the parameters line up in single columns,
  1716.                they're easier to read that way (hint: use the tab key).
  1717.            2.  You MAY leave blank lines. The compiler ignores them.
  1718.            3.  One command is executed each cycle unless otherwise noted.
  1719.            4.  Examining the sample robots is the best teacher.
  1720.            5.  Commands may be upper-case, lower-case, or any combination.
  1721.            6.  Never make multiple labels of the same ID number within the 
  1722.                same program.
  1723.            7.  All robots MUST have the extension AT2.
  1724.                   ex- MYROBOT.AT2, or THISGUY.AT2
  1725.  
  1726.   When you perform a scan, the number that is returned is the distance to
  1727. the nearest target within the scan arc. If no target is found, a huge number
  1728. is returned (specifically MAXINT, or 32767). This sets an internal variable
  1729. as well which is referred to as the "scan accuracy". This number can be
  1730. accessed by reading from the "accuracy" port. It will be a number from -2 to
  1731. +2. If the target was all the way on the left side of the scan, this number
  1732. will be -2. If it were on the right, +2. Dead center is 0, half-way to the
  1733. left is -1 and half way to the right is +1. Based upon the size of your scan
  1734. arc, you can use this number to figure out where the target is. The weapon
  1735. is capable of firing up to 4 degrees in either direction without turning the
  1736. turret or the whole robot, and so using the accuracy setting can be very
  1737. useful.
  1738.  
  1739.   There are several "setting" ports, such as the turret, and arc-width ports.
  1740. The default settings are as follows:  
  1741.  
  1742.   Item:               Value:
  1743.   --------------------------
  1744.    Turret Offset/shift  0
  1745.    Throttle             0
  1746.    Scan arc radius      8
  1747.    Overburn           off
  1748.    Keepshift          off
  1749.  
  1750.   All variables are set to 0 at the beginning of the battle. These settings
  1751. are all restored to default if the reset interrupt is called.
  1752.  
  1753.   Note that when you rotate the turret, EVERYthing that is on it turns 
  1754. with it. This includes the scanner AND the weapon.
  1755.  
  1756.   Remember to be careful with the stack. A program can get very mixed up if
  1757. you don't call the approprite RETs and POPs, in proper order, for all of
  1758. your CALL/GOSUB/GSB and PUSH commands.
  1759.  
  1760.   Also remember that if you aren't sure whether a particular section of
  1761. code is doing what you want, or you're not sure whether it is even executing
  1762. a section of program code, then try using the ERR instruction to display
  1763. the results of your calculations. The ERR command does not use up your
  1764. robot's CPU time, and can be very useful in tracking down bugs in the robot
  1765. (or in the game itself!) You may also want to turn on the display of
  1766. scan-arcs (/A parameter, or "A" key during battle) so that you can see
  1767. where your robot is looking.
  1768.  
  1769.  
  1770. ----------------------------------------------------------------------------
  1771. THE PHYSICS OF AT-ROBOTS:
  1772.  
  1773.   This section is purely theoretical and hypothetical, as it hopefully
  1774. will remain...  :-)
  1775.  
  1776.   Assuming that the arena is a square kilometer, and that the actual
  1777. simulated time runs at 10 cycles/second, we can extrapolate and extract
  1778. the following information: (you can see the game run at roughly this speed
  1779. with the /D100 parameter):
  1780.  
  1781. Robot Technical info:
  1782.  
  1783.   Length:                       8 meters   or  26.25 feet
  1784.                                 (in other words, a reasonably sized TANK)
  1785.  
  1786.   Max velocity (normal):        144.0 kph  or  089.48 mph
  1787.   Max velocity (overburn):      187.2 kph  or  116.32 mph
  1788.   Time from 0 to max speed:     2.5 seconds (0 to 116 in 2.5 seconds!?)
  1789.   Time to turn fully about:     1.6 seconds (even at full speed!?
  1790.                                              and without skidding!?!)
  1791.  
  1792.   Normal missile velocity:      1152 kph   or  715.84 mph
  1793.                                                (nearly 3/4 of mach 1)
  1794.  
  1795.   Processor speed:              50 hertz
  1796.   Maximum ROM program size:     8k
  1797.   RAM capacity:                 2k
  1798.  
  1799.   Ammunition supply:            Unlimited (missiles are generated from
  1800.                                         the on-board fusion power-plant).
  1801.  
  1802.  
  1803.   scary, huh?
  1804.  
  1805.   If you wanted to assume that the game runs at the default of about
  1806. 30 cycles per second, triple the speeds above. Even more scary, eh?
  1807.  
  1808.   And an even more scary thought is that these huge, fast tanks are
  1809. controlled by processors whose speed is measured in hertz, not megahertz.
  1810.  
  1811.  
  1812. ----------------------------------------------------------------------------
  1813. STAGING A COMPETITION:
  1814.  
  1815.   When staging a competition, be sure to specify the rules and the settings
  1816. that will be using in the game (such as timeslice, time limit, and number
  1817. of matches to be fought). These things must be decided ahead of time, so
  1818. that the players may optimize their robots for these settings.
  1819.  
  1820.   Make sure that all players involved are aware of the ATRLOCK program, so
  1821. that they don't have to give away their secrets easily.
  1822.  
  1823.   For specific details on configuration, be sure to see the sections on
  1824. command-line parameters and report-file formats. You can also go to the
  1825. website for more information (URL is at the top and bottom of this document).
  1826.  
  1827.   Also be sure to view the ATRT.DOC file for information on using ATRT,
  1828. the AT-Robots Tournament program.
  1829.  
  1830.  
  1831. ----------------------------------------------------------------------------
  1832. TROUBLE-SHOOTING & SPEED-CONTROL:
  1833.  
  1834.   The AT-Robots program is basically fully automatic and self-contained. It
  1835. will probably either work or it won't. If there is a problem, most likely
  1836. (but not definitely) you are out of luck. Here are some possible causes of
  1837. your difficulty:
  1838.  
  1839.                  1.  Not enough memory.
  1840.                  2.  Incompatable graphics adapter.
  1841.                  3.  Damaged copy of AT-Robots.
  1842.                  4.  Computer is not sufficiently IBM compatable.
  1843.                  5.  You haven't followed any of the instructions.
  1844.                  6.  Computer is damaged or not performing properly.
  1845.                  7.  You're using too early a version of DOS.
  1846.                      (suggest DOS 3.3 or higher)
  1847.                  8.  Hardware/software conflict
  1848.  
  1849.   If you HAVE gotten the program to run, but it's too slow, there are some
  1850. things you can do to speed it up. First, You can try putting only 2 or 3 
  1851. robots in the arena at once. You will find that the program slows down a lot
  1852. when you put 5 or 6. Another thing you can do is put the /D0 setting in. That
  1853. will turn off the delay that is placed in the program to keep it running at
  1854. the proper speed on faster computers. Usually the delay won't need to be
  1855. cranked down unless you're using an older computer (286 or 386).
  1856.  
  1857. ----------------------------------------------------------------------------
  1858. LEGAL SHTUFFS:
  1859.  
  1860.   This game was originally distributed as shareware. This has changed to
  1861. "Freeware", which basically means that you are granted free license to
  1862. make use of this software without paying for it, but the author retains
  1863. all rights (including copyrights) to it, including the source code, 
  1864. executables, documentation, and associated files, as per the license
  1865. displayed below. You are also encouraged to give copies of it to your
  1866. friends, and upload it to bulletin boards.
  1867.  
  1868. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1869. LICENSE & DISCLAIMER:
  1870.  
  1871. Copyright (c) 1999, Ed T. Toton III. All rights reserved.
  1872.  
  1873. Redistribution and use in source and binary forms, with or without
  1874. modification, are permitted provided that the following conditions
  1875. are met:
  1876.  
  1877.    Redistributions of source code must retain the above copyright notice,
  1878.    this list of conditions and the following disclaimer.
  1879.  
  1880.    Redistributions in binary form must reproduce the above copyright notice, 
  1881.    this list of conditions and the following disclaimer in the documentation
  1882.    and/or other materials provided with the distribution.
  1883.  
  1884.    All advertising materials mentioning features or use of this software
  1885.    must display the following acknowledgement:
  1886.  
  1887.         This product includes software developed by Ed T. Toton III &
  1888.         NecroBones Enterprises.
  1889.  
  1890.    No modified or derivative copies or software may be distributed in the
  1891.    guise,of official or original releases/versions of this software. Such
  1892.    works must contain acknowledgement that it is modified from the original.
  1893.  
  1894.    Neither the name of the author nor the name of the business or
  1895.    contributers may be used to endorse or promote products derived
  1896.    from this software without specific prior written permission.
  1897.  
  1898. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY 
  1899. EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
  1900. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  1901. DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
  1902. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  1903. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  1904. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  1905. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  1906. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  1907. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1908.  
  1909. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1910. REGISTRATION:
  1911.  
  1912.   Registering is not required. In fact, registration codes are only a
  1913. throw-back to the days when this was distributed as shareware instead of
  1914. freeware. These days, registration codes will rarely be handed out, but
  1915. here's what to do should you get one:
  1916.  
  1917.   Once you register you will get a registration code that will disable
  1918. the nag-messages. To use it, either enter the info using the ATROBS SHELL
  1919. or enter it into a data file manually.
  1920.  
  1921.   To do it manually, simply do the following from the DOS prompt:
  1922.  
  1923. COPY CON ATR2.REG<enter>
  1924. <reg name goes here> <enter>
  1925. <reg number goes here> <enter>
  1926. ^Z
  1927.  
  1928.   In the above, anything inside angle brackets indicates what to put.
  1929. Also, ^Z means Ctrl-Z or F6.
  1930.  
  1931.   Another way is to simply enter the two lines in a text editor and save
  1932. it under the filename of ATR2.REG.
  1933.  
  1934. example:
  1935.  
  1936. John A. Smith
  1937. 1234567
  1938.  
  1939.   The capitalization COUNTS! It must appear precisely as it does on your
  1940. registration response.
  1941.  
  1942.  
  1943. ----------------------------------------------------------------------------
  1944. REVISION HISTORY:
  1945.  
  1946.   All of the 2.00 versions were beta versions.
  1947.   The first non-beta was version 2.01.
  1948.  
  1949.   2.00a   -  In-house test version.
  1950.  
  1951.   2.00b   -  First public release, beta test.
  1952.  
  1953.   2.00c   -  INC and DEC instructions fixed (used to be backwards)
  1954.  
  1955.   2.00d   -  Fixed a documentation error: Port 12 & 13
  1956.           -  General DOC updates, spelling fixes, & clarifications added
  1957.           -  New LOCK feature to encrypt/scramble robots for distribution.
  1958.  
  1959.   2.00e   -  More Documentation clarifications
  1960.           -  'S' key to toggle sound on/off now works.
  1961.           -  LOCK program now copies header of comments over to
  1962.                LOCKed copy before encoding.
  1963.           -  Heat generation/dissipation is now itemized in DOCs.
  1964.           -  Reverse throttle added
  1965.           -  You can now add comments after labels and compiler
  1966.                directives (on the same line).
  1967.           -  Find-Angle interrupt added.
  1968.           -  Find enemy ID interrupt added.
  1969.           -  Registration codes added.
  1970.           -  #MSG compiler directive added (message display was
  1971.                already implemented in version 2.00a, but there was
  1972.                no way to define the message).
  1973.           -  #TIME directive added.
  1974.           -  AT-Robots Shell now included.
  1975.           -  TABs are handled more effectively by the compiler now.
  1976.  
  1977.   2.00f   -  New error code:  Divide by 0. (It would have previously
  1978.                 caused the GAME, not the robot, to have a runtime error).
  1979.           -  Shell is now complete  :-)  (was missing a file)
  1980.  
  1981.   2.00g   -  Bug fixed with robots taking missile damage. (bug was
  1982.                introduced in 2.00e)
  1983.  
  1984.   2.00h   -  JLE/JBE and JAE/JGE instructions now work (they used to
  1985.                see if something was less/greater than AND equal instead
  1986.                of OR, and would therefore never jump).
  1987.           -  SAL and SAR instructions added, for signed bit-shifts.
  1988.           -  NEG instruction added
  1989.           -  Heat-bar graphs are now only re-drawn when a visible
  1990.                change ocurrs. (for the sake of run-time efficiency)
  1991.           -  Robots now dissipate an extra point of heat every 8 game
  1992.                cycles if abs(throttle)<=25.
  1993.           -  Interrupt 9 (target info) added.
  1994.           -  Collision distance reduced (robots now have a radius
  1995.              of 4 meters instead of 6).
  1996.  
  1997.   2.00i  -  "The Physics of AT-Robots" added to DOC file.
  1998.          -  RAM address 3 "accuracy", now works
  1999.          -  RAM addresses 0 and 1 were reversed in DOC file, now fixed.
  2000.          -  New GIF to replace old robot schematic.
  2001.          -  LOCK program renamed ATRLOCK to avoid confusion with
  2002.               LOCK command for locking files in Win95.
  2003.          -  More documentation clarifications and explanations.
  2004.          -  Program code can now be accessed (but not changed) by
  2005.               normal pointers ("@" codes).
  2006.          -  Constants added for interrupts 7 through 9.
  2007.          -  Range-checking on GET and PUT added.
  2008.          -  New label-addressing mode added.
  2009.          -  JTL instruction added.
  2010.          -  Jump/CALL range-checking improved.
  2011.          -  Find-angle interrupt sped up.
  2012.          -  New sample robots: SWEEPER, TRACON
  2013.          -  Scan "accuracy" fixed. Used to return -2,0,+2,
  2014.               but never -1 or +1.
  2015.          -  Minimum scan-arc reduced from 1 to 0.
  2016.          -  Interrupt 10 (Game-info) added.
  2017.          -  Interrupt 11 (Robot-info) added.
  2018.          -  Missiles now have a little more room along the walls
  2019.             (they don't dissappear within the viewport anymore)
  2020.          -  Number of wins is now displayed in robot status display.
  2021.  
  2022.   2.00j  -  Compiler is even more accepting of TABs and other
  2023.               extraneous control-characters.
  2024.          -  Collision count (interrupts 12 and 13) added.
  2025.          -  Error #10 added (invalid interrupt call).
  2026.          -  Error #11 added (invalid port access).
  2027.          -  SDUCK now accesses the correct port to randomly
  2028.               aim its turret...  ooh yay.
  2029.          -  RANDMAN has been slightly improved (so as not to get
  2030.               stuck on the walls as much)
  2031.          -  Minor adjustment to the missile blast algorithm.
  2032.  
  2033.   2.00k  -  Minor adjustment made to the movement routine. A rounding
  2034.               error made it impossible to go at heading 192 (left)
  2035.               at a Y of 0 (north wall). This has been fixed.
  2036.  
  2037.   2.00l  -  Minor internal re-arrangements to make the code a little
  2038.               more organized.
  2039.          -  Transponder functions added- Port 19.
  2040.          -  Robots can no longer start a battle inside of each
  2041.               other (I never actually saw this happen, but it was
  2042.               theoretically possible).
  2043.          -  Port 20, shutdown level added.
  2044.          -  Robots now take damage faster in the heat range
  2045.               of 475 to 499.
  2046.          -  Minor adjustment to the rounding in the scan accuracy returns.
  2047.  
  2048.   2.01   -  First NON-Beta release.
  2049.          -  ERROR now works as an alternate for ERR.
  2050.          -  Windoze setting (/W)
  2051.          -  Minor clean-ups to increase game stability.
  2052.  
  2053.   2.02   -  Adjusted Sniper to not intentionally generate errors.
  2054.          -  Robot Software-resets now reset the entire stack and
  2055.               RAM memory for the robot. It used to be that from one
  2056.               round to the next in tournaments, the values of the
  2057.               stack, registers, and collision count, etc were preserved.
  2058.          -  Robot communication system added. Also added two sample robots,
  2059.               RECEIVE.AT2 and TRANSMIT.AT2 to demonstrate it. Interrupts
  2060.               14, 15, & 16 added, and port 21 added for communications.
  2061.  
  2062.   2.03   -  Kills/Deaths are now tracked and displayed.
  2063.          -  Display area slightly modified (especially in color) to
  2064.               accomodate the increasing crowding of displayed data.
  2065.          -  New report mode /R2 added, so that third-party tournament
  2066.               programs can track kills/deaths. /R report mode still
  2067.               works the same way it always did, for compatability with
  2068.               the existing ATRT program.
  2069.          -  Documentation fixes (some spelling errors corrected, as well
  2070.               as a few corrections to the sample code)
  2071.          -  Interrupts 17 & 18 added (clearcom, and kill/death count)
  2072.          -  Finally, that bug that screwed up the results in the first
  2073.               tournament has been found and stamped out. Robot's scanning
  2074.               with an arc of 0 with the simulation graphics off will now
  2075.               actually find their targets.
  2076.          -  Indirect addressing. Example: MOV AX,[BX]
  2077.  
  2078.   2.04   -  /R3 report mode added: Also gives info on robot armor & heat
  2079.               at the end of the last round (or at the time of last death,
  2080.               as the case may be). It also gives the shots-fired count,
  2081.               which is a total over all the matches played out.
  2082.          -  Trademarks & Copyrights section put back into documentation
  2083.               (I must have misplaced it somewhere along the way)
  2084.          -  Added more detail to the Introduction section of this doc.
  2085.          -  Robot hardware configurations added! This includes a shield
  2086.               and mine-layer, which use ports 22, 23, and 24. Configs are
  2087.               done with compiler directives. Robot TRAPPER.AT2 added to
  2088.               demonstrate the shield, minelayer, and config directives.
  2089.          -  New "meters" counter in memory. You can use this to keep track
  2090.               of distance travelled, perhaps for spacing mines. 'Meters'
  2091.               is a variable you can call by name. Int 19 resets it to 0.
  2092.               Writing to the variable doesn't do anything.
  2093.          -  'W' can now be pressed during the simulation to toggle 'windoze'
  2094.          -  Backspace key can now be used to end a single match, without
  2095.               ending the entire sequence of matches.
  2096.          -  Fixed a bug in the scan-accuracy returns. It would sometimes
  2097.               return some very screwy data for large scan-arcs (20 and
  2098.               lower seemed to work well before). This quirk has been fixed.
  2099.          -  Error-logging for robots now available. /E parameter activates
  2100.               it. Logs will be stored as the same filename as the robot,
  2101.               except with a .ERR extension. May be useful for debugging
  2102.               robots.
  2103.          -  ATRT Tournament program is now included (it has also been
  2104.               slightly modified). See ATRT.DOC for details.
  2105.          -  All match-results now display shots-fired. The count for the
  2106.               match is displayed for each match, and the total count over
  2107.               all the matches is displayed in the final results chart.
  2108.  
  2109.   2.05   -  Fixed a bug in ATRLOCK in which the first command or compiler
  2110.               directive in the robot to be locked would not be included in
  2111.               the locked copy.
  2112.          -  Automatic shutdown now turns off the shield, if it's on.
  2113.               TRAPPER.AT2 has been modified to adjust its shutdown level.
  2114.          -  Mine detonations now actually damage the robot that dropped them.
  2115.  
  2116.   2.06   -  ATR2 no longer displays the source code for locked robots during
  2117.               compile. (ooops!!)  I'm not sure when this bug first appeared.
  2118.               (Well, it wasn't rediculously secure anyway, but still)
  2119.          -  Both ATR2 and ATRLOCK now use a slightly modified encryption
  2120.               so that robots locked from now on will not be viewable in
  2121.               older versions of ATR2. However, older locked robots will
  2122.               still be usable (it's downwardly compatible).
  2123.          -  ATRLOCK has been made more tolerant of Tabs and other control
  2124.               characters (turns them into spaces).
  2125.  
  2126.   2.07   -  Some miscellaneous clean-ups in the compiler and LOCK decoder.
  2127.          -  Shield has been severely castrated to restore game balance.
  2128.               This is supposed to be more of a sharp-shooting game, so the
  2129.               shield had to be weakened. Using it effectively will now be
  2130.               more of a challenge. :-)
  2131.  
  2132.   2.08   -  Fixed a bug that allowed you to get more than the maximum
  2133.               number of config points.
  2134.          -  Int 19 actually works now (man, that's embarrassing).
  2135.          -  /# parameter added to specify max robot program length.
  2136.          -  Changed to a variant of the BSD license, thus allowing the
  2137.               source code to be distributable.
  2138.          -  LOCK3 encryption added. The key does not reset on each line,
  2139.               and it propogates errors, so single character changes should
  2140.               ruin the decryption process.
  2141.          -  Memory location 13, last target's absolute speed (in cm/cycle)
  2142.          -  Added /@ switch to allow old-style shields.
  2143.          -  Documented the previously undocumented /! parameter
  2144.               (insane missiles).
  2145.          -  Fixed some confusion in TRAPPER.AT2, improving it slightly.
  2146.          -  Added report file formats to the docs.
  2147.          -  /R4 report mode added. (now documented)
  2148.          -  Fixed a huge security hole via range-checking.
  2149.          -  Fixed documentation for port 11, throttle setting.
  2150.          -  /W parameter (and "W" key too) Windoze setting has been extended
  2151.               to also affect the display of intermediate battle results in
  2152.               text mode (and no longer just in graphics mode).
  2153.          -  Added SNIPER2.AT2 and WALLBOMB.AT2 sample robots.
  2154.          -  #msg now allows use of punctuation and lowercase.
  2155.          -  Some ATRT enhancements.
  2156.          -  Lowered the max cycle limit and max number of matches to
  2157.               100,000 each (to help reduce the chances of variable
  2158.               overflows).
  2159.  
  2160.   2.09   -  ATRT updated to be more compatibile with /# parameter.
  2161.          -  Maximum number of robots increased to 32. The status
  2162.               display now automatically condenses to fit more robots
  2163.               in when necessary.
  2164.          -  "Q" key has been changed to toggle sound along with "S",
  2165.               rather than quit. ESCAPE can still be used to quit, however.
  2166.               This was done so that the keyboard commands would more closely
  2167.               match the command-line parameters.
  2168.          -  Default time limit changed to 100,000 cycles (instead of
  2169.               defaulting to no limit at all).
  2170.          -  Status area now displays amount of left-over DOS memory in
  2171.               bytes, so you can see how close to the limit you are.
  2172.          -  "Chaos" batch file and config file added to demonstrate 32-robot
  2173.               battles using the sample robots. Just run "Chaos" to see.
  2174.          -  Fixed an array-overflow problem with mines.
  2175.          -  Increased number of mines. Updated WALLBOMB.AT2 and TRAPPER.AT2
  2176.               to accomodate.
  2177.  
  2178.   2.10   -  ATRT enhancements, particularly to facilitate unattended runs.
  2179.          -  You can now enter pre-compiled machine code into your programs.
  2180.          -  Simulation now checks for invalid microcode, and will not
  2181.               execute instructions that are thus invalid (invalid instructions
  2182.               as such will use up 1 cpu cycle when skipped, regardless of
  2183.               what the instruction was).
  2184.          -  Source code re-arranged slightly to overcome code-segment
  2185.               limitations.
  2186.          -  Debugger added (see command-line parameter and keyboard
  2187.               command sections for details). Thanks to FiFi LaRoo
  2188.               for making the debugger.
  2189.          -  Fixed a bug in SAR and SAL commands that made them more or less
  2190.               ignore the second operand.
  2191.  
  2192.  
  2193.  
  2194. ----------------------------------------------------------------------------
  2195.  
  2196.  
  2197. Well, that's all! Have fun!!!
  2198.  
  2199.  
  2200. For current CONTACT INFORMATION see:   NBONES.DOC
  2201.  
  2202.  
  2203.                                                         -Ed T. Toton III
  2204.                                                              "Bones"
  2205.                                                       NecroBones Software.
  2206.  
  2207. ----------------------------------------------------------------------------
  2208.                      http://www.necrobones.com/atrobots/
  2209.